home *** CD-ROM | disk | FTP | other *** search
/ SGI Developer Toolbox 6.1 / SGI Developer Toolbox 6.1 - Disc 4.iso / public / rayshade / Doc / Guide / objects.tex < prev    next >
LaTeX Document  |  1994-08-02  |  16.1 KB

open in: MacOS 8.1     |     Win98     |     DOS

browse contents    |     view JSON data     |     view as text


This file was processed as: LaTeX Document (document/latex).

ConfidenceProgramDetectionMatch TypeSupport
100% dexvert LaTeX Document (document/latex) magic Supported
1% dexvert Corel 10 Texture (image/corel10Texture) ext Unsupported
1% dexvert Croteam texture file (image/croteamTextureFile) ext Unsupported
1% dexvert Text File (text/txt) fallback Supported
100% file LaTeX document text default
99% file LaTeX document, ASCII text default
100% checkBytes Printable ASCII default
100% perlTextCheck Likely Text (Perl) default
100% siegfried fmt/281 LaTeX (Subdocument) default
100% detectItEasy Format: plain text[LF] default (weak)



hex view
+--------+-------------------------+-------------------------+--------+--------+
|00000000| 5c 63 68 61 70 74 65 72 | 7b 4f 62 6a 65 63 74 20 |\chapter|{Object |
|00000010| 44 65 66 69 6e 69 74 69 | 6f 6e 7d 0a 0a 4f 62 6a |Definiti|on}..Obj|
|00000020| 65 63 74 73 20 69 6e 20 | 7b 5c 72 61 79 73 68 61 |ects in |{\raysha|
|00000030| 64 65 7d 20 61 72 65 20 | 63 6f 6d 70 6f 73 65 64 |de} are |composed|
|00000040| 20 6f 66 20 72 65 6c 61 | 74 69 76 65 6c 79 20 73 | of rela|tively s|
|00000050| 69 6d 70 6c 65 20 7b 5c | 65 6d 20 70 72 69 6d 69 |imple {\|em primi|
|00000060| 74 69 76 65 7d 0a 6f 62 | 6a 65 63 74 73 2e 20 20 |tive}.ob|jects. |
|00000070| 54 68 65 73 65 20 70 72 | 69 6d 69 74 69 76 65 73 |These pr|imitives|
|00000080| 20 6d 61 79 20 62 65 20 | 75 73 65 64 20 62 79 20 | may be |used by |
|00000090| 74 68 65 6d 73 65 6c 76 | 65 73 2c 20 6f 72 20 74 |themselv|es, or t|
|000000a0| 68 65 79 0a 6d 61 79 20 | 62 65 20 63 6f 6d 62 69 |hey.may |be combi|
|000000b0| 6e 65 64 20 74 6f 20 66 | 6f 72 6d 20 6d 6f 72 65 |ned to f|orm more|
|000000c0| 20 63 6f 6d 70 6c 65 78 | 20 6f 62 6a 65 63 74 73 | complex| objects|
|000000d0| 20 6b 6e 6f 77 6e 20 61 | 73 20 7b 5c 65 6d 20 61 | known a|s {\em a|
|000000e0| 67 67 72 65 67 61 74 65 | 73 7d 2e 0a 41 20 73 70 |ggregate|s}..A sp|
|000000f0| 65 63 69 61 6c 20 66 61 | 6d 69 6c 79 20 6f 66 20 |ecial fa|mily of |
|00000100| 61 67 67 72 65 67 61 74 | 65 20 6f 62 6a 65 63 74 |aggregat|e object|
|00000110| 73 2c 0a 7b 5c 65 6d 20 | 43 6f 6e 73 74 72 75 63 |s,.{\em |Construc|
|00000120| 74 69 76 65 20 53 6f 6c | 69 64 20 47 65 6f 6d 65 |tive Sol|id Geome|
|00000130| 74 72 79 7d 20 6f 72 20 | 43 53 47 0a 6f 62 6a 65 |try} or |CSG.obje|
|00000140| 63 74 73 2c 20 61 72 65 | 20 74 68 65 20 72 65 73 |cts, are| the res|
|00000150| 75 6c 74 20 6f 66 20 61 | 20 62 6f 6f 6c 65 61 6e |ult of a| boolean|
|00000160| 20 6f 70 65 72 61 74 69 | 6f 6e 73 20 61 70 70 6c | operati|ons appl|
|00000170| 69 65 64 20 74 6f 0a 70 | 72 69 6d 69 74 69 76 65 |ied to.p|rimitive|
|00000180| 2c 20 61 67 67 72 65 67 | 61 74 65 2c 20 6f 72 20 |, aggreg|ate, or |
|00000190| 43 53 47 20 6f 62 6a 65 | 63 74 73 2e 0a 0a 54 68 |CSG obje|cts...Th|
|000001a0| 69 73 20 63 68 61 70 74 | 65 72 20 64 65 73 63 72 |is chapt|er descr|
|000001b0| 69 62 65 73 20 6f 62 6a | 65 63 74 73 20 66 72 6f |ibes obj|ects fro|
|000001c0| 6d 20 61 20 73 74 72 69 | 63 74 6c 79 20 67 65 6f |m a stri|ctly geo|
|000001d0| 6d 65 74 72 69 63 20 70 | 6f 69 6e 74 20 6f 66 0a |metric p|oint of.|
|000001e0| 76 69 65 77 2e 20 20 4c | 61 74 65 72 20 63 68 61 |view. L|ater cha|
|000001f0| 70 74 65 72 73 20 6f 6e | 20 73 75 72 66 61 63 65 |pters on| surface|
|00000200| 73 2c 20 74 65 78 74 75 | 72 65 73 2c 20 61 6e 64 |s, textu|res, and|
|00000210| 20 73 68 61 64 69 6e 67 | 20 64 65 73 63 72 69 62 | shading| describ|
|00000220| 65 0a 68 6f 77 20 6f 62 | 6a 65 63 74 20 61 70 70 |e.how ob|ject app|
|00000230| 65 61 72 61 6e 63 65 73 | 20 61 72 65 20 64 65 66 |earances| are def|
|00000240| 69 6e 65 64 2e 0a 0a 41 | 6e 20 7b 5c 65 6d 20 69 |ined...A|n {\em i|
|00000250| 6e 73 74 61 6e 63 65 7d | 20 69 73 20 61 6e 20 6f |nstance}| is an o|
|00000260| 62 6a 65 63 74 20 74 68 | 61 74 20 68 61 73 20 6f |bject th|at has o|
|00000270| 70 74 69 6f 6e 61 6c 6c | 79 20 62 65 65 6e 20 74 |ptionall|y been t|
|00000280| 72 61 6e 73 66 6f 72 6d | 65 64 0a 61 6e 64 0a 74 |ransform|ed.and.t|
|00000290| 65 78 74 75 72 65 64 2e | 20 20 54 68 65 79 20 61 |extured.| They a|
|000002a0| 72 65 20 74 68 65 20 65 | 6e 74 69 74 69 65 73 20 |re the e|ntities |
|000002b0| 74 68 61 74 20 61 72 65 | 20 61 63 74 75 61 6c 6c |that are| actuall|
|000002c0| 79 20 72 65 6e 64 65 72 | 65 64 20 62 79 0a 7b 5c |y render|ed by.{\|
|000002d0| 72 61 79 73 68 61 64 65 | 7d 3b 20 77 68 65 6e 20 |rayshade|}; when |
|000002e0| 79 6f 75 20 73 70 65 63 | 69 66 79 20 74 68 61 74 |you spec|ify that|
|000002f0| 2c 20 66 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 61 |, for ex|ample, a|
|00000300| 20 74 65 78 74 75 72 65 | 64 0a 73 70 68 65 72 65 | texture|d.sphere|
|00000310| 20 69 73 20 74 6f 20 62 | 65 20 72 65 6e 64 65 72 | is to b|e render|
|00000320| 65 64 2c 20 79 6f 75 20 | 61 72 65 20 73 61 69 64 |ed, you |are said|
|00000330| 20 74 6f 20 62 65 20 69 | 6e 73 74 61 6e 74 69 61 | to be i|nstantia|
|00000340| 74 69 6e 67 0a 74 68 65 | 20 74 65 78 74 75 72 65 |ting.the| texture|
|00000350| 64 20 73 70 68 65 72 65 | 2e 0a 41 6e 20 69 6e 73 |d sphere|..An ins|
|00000360| 74 61 6e 63 65 0a 69 73 | 20 73 70 65 63 69 66 69 |tance.is| specifi|
|00000370| 65 64 20 61 73 20 61 20 | 70 72 69 6d 69 74 69 76 |ed as a |primitiv|
|00000380| 65 2c 20 61 67 67 72 65 | 67 61 74 65 2c 20 6f 72 |e, aggre|gate, or|
|00000390| 20 43 53 47 20 6f 62 6a | 65 63 74 20 74 68 61 74 | CSG obj|ect that|
|000003a0| 0a 69 73 20 66 6f 6c 6c | 6f 77 65 64 20 62 79 20 |.is foll|owed by |
|000003b0| 6f 70 74 69 6f 6e 61 6c | 20 74 72 61 6e 73 66 6f |optional| transfo|
|000003c0| 72 6d 61 74 69 6f 6e 20 | 61 6e 64 20 74 65 78 74 |rmation |and text|
|000003d0| 75 72 69 6e 67 20 69 6e | 66 6f 72 6d 61 74 69 6f |uring in|formatio|
|000003e0| 6e 2e 0a 54 72 61 6e 73 | 66 6f 72 6d 61 74 69 6f |n..Trans|formatio|
|000003f0| 6e 73 20 61 6e 64 20 74 | 65 78 74 75 72 65 73 20 |ns and t|extures |
|00000400| 61 72 65 20 64 65 73 63 | 72 69 62 65 64 20 69 6e |are desc|ribed in|
|00000410| 20 43 68 61 70 74 65 72 | 73 20 37 20 61 6e 64 20 | Chapter|s 7 and |
|00000420| 38 20 72 65 73 70 65 63 | 74 69 76 65 6c 79 2e 0a |8 respec|tively..|
|00000430| 0a 5c 73 65 63 74 69 6f | 6e 7b 54 68 65 20 57 6f |.\sectio|n{The Wo|
|00000440| 72 6c 64 20 4f 62 6a 65 | 63 74 7d 0a 0a 57 72 69 |rld Obje|ct}..Wri|
|00000450| 74 69 6e 67 20 61 20 7b | 5c 72 61 79 73 68 61 64 |ting a {|\rayshad|
|00000460| 65 7d 20 69 6e 70 75 74 | 20 66 69 6c 65 20 69 73 |e} input| file is|
|00000470| 20 70 72 69 6e 63 69 70 | 61 6c 6c 79 0a 61 20 6d | princip|ally.a m|
|00000480| 61 74 74 65 72 20 6f 66 | 20 64 65 66 69 6e 69 6e |atter of| definin|
|00000490| 67 20 61 20 73 70 65 63 | 69 61 6c 20 61 67 67 72 |g a spec|ial aggr|
|000004a0| 65 67 61 74 65 20 6f 62 | 6a 65 63 74 2c 20 74 68 |egate ob|ject, th|
|000004b0| 65 20 57 6f 72 6c 64 20 | 6f 62 6a 65 63 74 2c 0a |e World |object,.|
|000004c0| 77 68 69 63 68 20 69 73 | 20 61 20 6c 69 73 74 20 |which is| a list |
|000004d0| 6f 66 20 74 68 65 20 6f | 62 6a 65 63 74 73 20 69 |of the o|bjects i|
|000004e0| 6e 20 74 68 65 20 73 63 | 65 6e 65 2e 20 20 57 68 |n the sc|ene. Wh|
|000004f0| 65 6e 20 77 72 69 74 69 | 6e 67 20 61 20 7b 5c 72 |en writi|ng a {\r|
|00000500| 61 79 73 68 61 64 65 7d | 0a 69 6e 70 75 74 20 66 |ayshade}|.input f|
|00000510| 69 6c 65 2c 20 61 6c 6c | 20 6f 62 6a 65 63 74 73 |ile, all| objects|
|00000520| 20 74 68 61 74 20 61 72 | 65 20 69 6e 73 74 61 6e | that ar|e instan|
|00000530| 74 69 61 74 65 64 20 6f | 75 74 73 69 64 65 20 6f |tiated o|utside o|
|00000540| 66 20 6f 62 6a 65 63 74 | 2d 64 65 66 69 6e 69 74 |f object|-definit|
|00000550| 69 6f 6e 0a 62 6c 6f 63 | 6b 73 20 61 72 65 20 61 |ion.bloc|ks are a|
|00000560| 64 64 65 64 20 74 6f 20 | 74 68 65 20 57 6f 72 6c |dded to |the Worl|
|00000570| 64 20 6f 62 6a 65 63 74 | 3b 20 79 6f 75 20 6e 65 |d object|; you ne|
|00000580| 65 64 20 6e 6f 74 20 28 | 6e 6f 72 20 73 68 6f 75 |ed not (|nor shou|
|00000590| 6c 64 20 79 6f 75 29 0a | 64 65 66 69 6e 65 20 74 |ld you).|define t|
|000005a0| 68 65 20 57 6f 72 6c 64 | 20 6f 62 6a 65 63 74 20 |he World| object |
|000005b0| 65 78 70 6c 69 63 69 74 | 6c 79 20 69 6e 20 74 68 |explicit|ly in th|
|000005c0| 65 20 69 6e 70 75 74 20 | 66 69 6c 65 2e 0a 0a 5c |e input |file...\|
|000005d0| 73 65 63 74 69 6f 6e 7b | 50 72 69 6d 69 74 69 76 |section{|Primitiv|
|000005e0| 65 73 7d 0a 0a 50 72 69 | 6d 69 74 69 76 65 20 6f |es}..Pri|mitive o|
|000005f0| 62 6a 65 63 74 73 20 61 | 72 65 20 74 68 65 20 62 |bjects a|re the b|
|00000600| 75 69 6c 64 69 6e 67 20 | 62 6f 78 20 77 69 74 68 |uilding |box with|
|00000610| 20 77 68 69 63 68 20 6f | 74 68 65 72 20 6f 62 6a | which o|ther obj|
|00000620| 65 63 74 73 20 61 72 65 | 0a 63 72 65 61 74 65 64 |ects are|.created|
|00000630| 2e 20 20 45 61 63 68 20 | 70 72 69 6d 69 74 69 76 |. Each |primitiv|
|00000640| 65 20 74 79 70 65 20 68 | 61 73 20 61 73 73 6f 63 |e type h|as assoc|
|00000650| 69 61 74 65 64 20 77 69 | 74 68 20 69 74 20 73 70 |iated wi|th it sp|
|00000660| 65 63 69 61 6c 69 7a 65 | 64 0a 6d 65 74 68 6f 64 |ecialize|d.method|
|00000670| 73 20 66 6f 72 0a 63 72 | 65 61 74 69 6f 6e 2c 0a |s for.cr|eation,.|
|00000680| 69 6e 74 65 72 73 65 63 | 74 69 6f 6e 20 77 69 74 |intersec|tion wit|
|00000690| 68 20 61 20 72 61 79 2c | 0a 62 6f 75 6e 64 69 6e |h a ray,|.boundin|
|000006a0| 67 20 62 6f 78 20 63 61 | 6c 63 75 6c 61 74 69 6f |g box ca|lculatio|
|000006b0| 6e 2c 0a 73 75 72 66 61 | 63 65 20 6e 6f 72 6d 61 |n,.surfa|ce norma|
|000006c0| 6c 20 63 61 6c 63 75 6c | 61 74 69 6f 6e 2c 0a 72 |l calcul|ation,.r|
|000006d0| 61 79 20 65 6e 74 65 72 | 2f 65 78 69 74 20 63 6c |ay enter|/exit cl|
|000006e0| 61 73 73 69 66 69 63 61 | 74 69 6f 6e 2c 0a 61 6e |assifica|tion,.an|
|000006f0| 64 20 66 6f 72 20 74 68 | 65 20 63 6f 6d 70 75 74 |d for th|e comput|
|00000700| 61 74 69 6f 6e 20 32 44 | 20 74 65 78 74 75 72 65 |ation 2D| texture|
|00000710| 20 63 6f 6f 72 64 69 6e | 61 74 65 73 20 74 65 72 | coordin|ates ter|
|00000720| 6d 65 64 20 7b 5c 65 6d | 20 75 2d 76 7d 0a 63 6f |med {\em| u-v}.co|
|00000730| 6f 72 64 69 6e 61 74 65 | 73 2e 0a 54 68 69 73 20 |ordinate|s..This |
|00000740| 6c 61 74 74 65 72 20 6d | 65 74 68 6f 64 20 69 73 |latter m|ethod is|
|00000750| 20 6f 66 74 65 6e 20 72 | 65 66 65 72 72 65 64 20 | often r|eferred |
|00000760| 74 6f 20 61 73 20 74 68 | 65 20 7b 5c 65 6d 20 69 |to as th|e {\em i|
|00000770| 6e 76 65 72 73 65 20 6d | 61 70 70 69 6e 67 7d 0a |nverse m|apping}.|
|00000780| 6d 65 74 68 6f 64 2e 0a | 0a 57 68 69 6c 65 20 6d |method..|.While m|
|00000790| 6f 73 74 20 6f 66 20 74 | 68 65 73 65 20 6d 65 74 |ost of t|hese met|
|000007a0| 68 6f 64 73 20 73 68 6f | 75 6c 64 20 62 65 20 6f |hods sho|uld be o|
|000007b0| 66 20 6c 69 74 74 6c 65 | 20 63 6f 6e 63 65 72 6e |f little| concern|
|000007c0| 20 74 6f 20 79 6f 75 2c | 20 74 68 65 0a 69 6e 76 | to you,| the.inv|
|000007d0| 65 72 73 65 20 6d 61 70 | 70 69 6e 67 20 6d 65 74 |erse map|ping met|
|000007e0| 68 6f 64 73 0a 77 69 6c | 6c 20 61 66 66 65 63 74 |hods.wil|l affect|
|000007f0| 20 74 68 65 20 77 61 79 | 20 69 6e 20 77 68 69 63 | the way| in whic|
|00000800| 68 20 63 65 72 74 61 69 | 6e 20 74 65 78 74 75 72 |h certai|n textur|
|00000810| 65 73 20 61 72 65 20 61 | 70 70 6c 69 65 64 20 74 |es are a|pplied t|
|00000820| 6f 20 70 72 69 6d 69 74 | 69 76 65 73 2e 0a 49 6e |o primit|ives..In|
|00000830| 76 65 72 73 65 20 6d 61 | 70 70 69 6e 67 20 69 73 |verse ma|pping is|
|00000840| 20 61 20 6d 61 74 74 65 | 72 20 6f 66 20 63 6f 6d | a matte|r of com|
|00000850| 70 75 74 69 6e 67 20 6e | 6f 72 6d 61 6c 69 7a 65 |puting n|ormalize|
|00000860| 64 20 24 75 24 20 61 6e | 64 20 24 76 24 20 63 6f |d $u$ an|d $v$ co|
|00000870| 6f 72 64 69 6e 61 74 65 | 73 0a 66 6f 72 20 61 20 |ordinate|s.for a |
|00000880| 67 69 76 65 6e 20 70 6f | 69 6e 74 20 6f 6e 20 74 |given po|int on t|
|00000890| 68 65 20 73 75 72 66 61 | 63 65 20 6f 66 20 74 68 |he surfa|ce of th|
|000008a0| 65 20 70 72 69 6d 69 74 | 69 76 65 2e 20 20 46 6f |e primit|ive. Fo|
|000008b0| 72 20 70 6c 61 6e 61 72 | 20 6f 62 6a 65 63 74 73 |r planar| objects|
|000008c0| 2c 0a 74 68 65 20 24 75 | 24 20 61 6e 64 20 24 76 |,.the $u|$ and $v|
|000008d0| 24 20 63 6f 6f 72 64 69 | 6e 61 74 65 73 20 6f 66 |$ coordi|nates of|
|000008e0| 20 61 20 70 6f 69 6e 74 | 20 61 72 65 20 63 6f 6d | a point| are com|
|000008f0| 70 75 74 65 64 0a 62 79 | 20 6c 69 6e 65 61 72 20 |puted.by| linear |
|00000900| 69 6e 74 65 72 70 6f 6c | 61 74 69 6f 6e 20 62 61 |interpol|ation ba|
|00000910| 73 65 64 20 75 70 6f 6e | 20 74 68 65 20 24 75 24 |sed upon| the $u$|
|00000920| 20 61 6e 64 20 24 76 24 | 20 63 6f 6f 72 64 69 6e | and $v$| coordin|
|00000930| 61 74 65 73 20 61 73 73 | 69 67 6e 65 64 0a 74 6f |ates ass|igned.to|
|00000940| 20 76 65 72 74 69 63 65 | 73 20 6f 72 20 6f 74 68 | vertice|s or oth|
|00000950| 65 72 20 6b 6e 6f 77 6e | 20 70 6f 69 6e 74 73 20 |er known| points |
|00000960| 6f 6e 20 74 68 65 20 70 | 72 69 6d 69 74 69 76 65 |on the p|rimitive|
|00000970| 2e 20 20 46 6f 72 20 6e | 6f 6e 2d 70 6c 61 6e 61 |. For n|on-plana|
|00000980| 72 0a 6f 62 6a 65 63 74 | 73 2c 20 24 75 76 24 20 |r.object|s, $uv$ |
|00000990| 63 6f 6d 70 75 74 61 74 | 69 6f 6e 20 63 61 6e 20 |computat|ion can |
|000009a0| 62 65 20 63 6f 6e 73 69 | 64 65 72 61 62 6c 79 20 |be consi|derably |
|000009b0| 6d 6f 72 65 20 69 6e 76 | 6f 6c 76 65 64 2e 0a 0a |more inv|olved...|
|000009c0| 54 68 69 73 20 73 65 63 | 74 69 6f 6e 20 62 72 69 |This sec|tion bri|
|000009d0| 65 66 6c 79 20 64 65 73 | 63 72 69 62 65 73 20 65 |efly des|cribes e|
|000009e0| 61 63 68 20 70 72 69 6d | 69 74 69 76 65 20 61 6e |ach prim|itive an|
|000009f0| 64 0a 74 68 65 20 73 79 | 6e 74 61 78 20 74 68 61 |d.the sy|ntax tha|
|00000a00| 74 20 73 68 6f 75 6c 64 | 20 62 65 20 75 73 65 64 |t should| be used|
|00000a10| 20 74 6f 20 63 72 65 61 | 74 65 20 61 6e 20 69 6e | to crea|te an in|
|00000a20| 73 74 61 6e 63 65 20 6f | 66 20 74 68 65 20 70 72 |stance o|f the pr|
|00000a30| 69 6d 69 74 69 76 65 2e | 0a 49 74 20 61 6c 73 6f |imitive.|.It also|
|00000a40| 20 64 65 73 63 72 69 62 | 65 73 20 74 68 65 20 69 | describ|es the i|
|00000a50| 6e 76 65 72 73 65 20 6d | 61 70 70 69 6e 67 20 6d |nverse m|apping m|
|00000a60| 65 74 68 6f 64 2c 20 69 | 66 20 61 6e 79 2c 20 66 |ethod, i|f any, f|
|00000a70| 6f 72 20 65 61 63 68 20 | 74 79 70 65 2e 0a 0a 5c |or each |type...\|
|00000a80| 62 65 67 69 6e 7b 64 65 | 66 70 72 69 6d 7d 7b 62 |begin{de|fprim}{b|
|00000a90| 6c 6f 62 7d 7b 7b 5c 65 | 6d 20 74 68 72 65 73 68 |lob}{{\e|m thresh|
|00000aa0| 20 73 74 20 72 7d 20 5c | 65 76 65 63 7b 70 7d 20 | st r} \|evec{p} |
|00000ab0| 5b 7b 5c 65 6d 20 73 74 | 20 72 7d 20 5c 65 76 65 |[{\em st| r} \eve|
|00000ac0| 63 7b 70 7d 20 5c 6c 64 | 6f 74 73 5d 7d 0a 09 44 |c{p} \ld|ots]}..D|
|00000ad0| 65 66 69 6e 65 73 20 61 | 20 62 6c 6f 62 20 77 69 |efines a| blob wi|
|00000ae0| 74 68 20 63 6f 6e 73 69 | 73 74 69 6e 67 20 6f 66 |th consi|sting of|
|00000af0| 20 61 20 74 68 72 65 73 | 68 6f 6c 64 20 65 71 75 | a thres|hold equ|
|00000b00| 61 6c 20 74 6f 20 7b 5c | 65 6d 20 74 68 72 65 73 |al to {\|em thres|
|00000b10| 68 7d 2c 0a 09 61 6e 64 | 20 61 0a 09 67 72 6f 75 |h},..and| a..grou|
|00000b20| 70 20 6f 66 20 6f 6e 65 | 20 6f 72 20 6d 6f 72 65 |p of one| or more|
|00000b30| 20 6d 65 74 61 62 61 6c | 6c 73 2e 20 20 45 61 63 | metabal|ls. Eac|
|00000b40| 68 20 6d 65 74 61 62 61 | 6c 6c 20 69 73 20 64 65 |h metaba|ll is de|
|00000b50| 66 69 6e 65 64 20 62 79 | 20 0a 09 69 74 73 20 70 |fined by| ..its p|
|00000b60| 6f 73 69 74 69 6f 6e 20 | 5c 65 76 65 63 7b 70 7d |osition |\evec{p}|
|00000b70| 2c 20 72 61 64 69 75 73 | 20 7b 5c 65 6d 20 72 7d |, radius| {\em r}|
|00000b80| 2c 20 61 6e 64 20 73 74 | 72 65 6e 67 74 68 20 7b |, and st|rength {|
|00000b90| 5c 65 6d 20 73 74 7d 2e | 0a 5c 65 6e 64 7b 64 65 |\em st}.|.\end{de|
|00000ba0| 66 70 72 69 6d 7d 0a 54 | 68 65 20 6d 65 74 61 62 |fprim}.T|he metab|
|00000bb0| 61 6c 6c 73 20 61 66 66 | 65 63 74 20 65 61 63 68 |alls aff|ect each|
|00000bc0| 20 6f 74 68 65 72 20 61 | 63 63 6f 72 64 69 6e 67 | other a|ccording|
|00000bd0| 20 74 6f 20 61 20 73 75 | 70 65 72 69 6d 70 6f 73 | to a su|perimpos|
|00000be0| 65 64 0a 64 65 6e 73 69 | 74 79 20 64 69 73 74 72 |ed.densi|ty distr|
|00000bf0| 69 62 75 74 69 6f 6e 3a | 0a 5c 5b 0a 46 28 78 2c |ibution:|.\[.F(x,|
|00000c00| 79 2c 7a 29 20 3d 20 5c | 73 75 6d 5f 7b 69 3d 30 |y,z) = \|sum_{i=0|
|00000c10| 7d 5e 6e 20 62 5f 7b 69 | 7d 65 5e 7b 2d 64 5f 7b |}^n b_{i|}e^{-d_{|
|00000c20| 69 7d 7d 20 2d 20 54 20 | 3d 20 30 0a 5c 5d 0a 54 |i}} - T |= 0.\].T|
|00000c30| 68 65 72 65 20 69 73 20 | 6e 6f 20 69 6e 76 65 72 |here is |no inver|
|00000c40| 73 65 20 6d 61 70 70 69 | 6e 67 20 6d 65 74 68 6f |se mappi|ng metho|
|00000c50| 64 20 66 6f 72 20 62 6c | 6f 62 73 2e 0a 0a 5c 62 |d for bl|obs...\b|
|00000c60| 65 67 69 6e 7b 64 65 66 | 70 72 69 6d 7d 7b 62 6f |egin{def|prim}{bo|
|00000c70| 78 7d 7b 5c 65 76 65 63 | 7b 63 6f 72 6e 65 72 31 |x}{\evec|{corner1|
|00000c80| 7d 20 5c 65 76 65 63 7b | 63 6f 72 6e 65 72 32 7d |} \evec{|corner2}|
|00000c90| 7d 0a 09 43 72 65 61 74 | 65 73 20 61 6e 20 61 78 |}..Creat|es an ax|
|00000ca0| 69 73 2d 61 6c 69 67 6e | 65 64 20 62 6f 78 0a 09 |is-align|ed box..|
|00000cb0| 77 68 69 63 68 20 68 61 | 73 20 5c 65 76 65 63 7b |which ha|s \evec{|
|00000cc0| 63 6f 72 6e 65 72 31 7d | 20 61 6e 64 20 5c 65 76 |corner1}| and \ev|
|00000cd0| 65 63 7b 63 6f 72 6e 65 | 72 32 7d 20 61 73 0a 09 |ec{corne|r2} as..|
|00000ce0| 6f 70 70 6f 73 69 74 65 | 20 63 6f 72 6e 65 72 73 |opposite| corners|
|00000cf0| 2e 0a 5c 65 6e 64 7b 64 | 65 66 70 72 69 6d 7d 0a |..\end{d|efprim}.|
|00000d00| 54 72 61 6e 73 66 6f 72 | 6d 61 74 69 6f 6e 73 20 |Transfor|mations |
|00000d10| 6d 61 79 20 62 65 20 61 | 70 70 6c 69 65 64 20 74 |may be a|pplied t|
|00000d20| 6f 20 74 68 65 20 62 6f | 78 20 69 66 20 61 20 6e |o the bo|x if a n|
|00000d30| 6f 6e 2d 61 78 69 73 2d | 61 6c 69 67 6e 65 64 20 |on-axis-|aligned |
|00000d40| 69 6e 73 74 61 6e 63 65 | 0a 69 73 20 72 65 71 75 |instance|.is requ|
|00000d50| 69 72 65 64 2e 20 20 54 | 68 65 72 65 20 69 73 20 |ired. T|here is |
|00000d60| 6e 6f 20 69 6e 76 65 72 | 73 65 20 6d 61 70 70 69 |no inver|se mappi|
|00000d70| 6e 67 20 6d 65 74 68 6f | 64 20 66 6f 72 20 62 6f |ng metho|d for bo|
|00000d80| 78 65 73 2e 0a 0a 5c 62 | 65 67 69 6e 7b 64 65 66 |xes...\b|egin{def|
|00000d90| 70 72 69 6d 7d 7b 73 70 | 68 65 72 65 7d 7b 7b 5c |prim}{sp|here}{{\|
|00000da0| 65 6d 20 72 61 64 69 75 | 73 7d 20 5c 65 76 65 63 |em radiu|s} \evec|
|00000db0| 7b 63 65 6e 74 65 72 7d | 7d 0a 09 43 72 65 61 74 |{center}|}..Creat|
|00000dc0| 65 73 20 61 20 73 70 68 | 65 72 65 20 77 69 74 68 |es a sph|ere with|
|00000dd0| 20 74 68 65 20 67 69 76 | 65 6e 20 7b 5c 65 6d 20 | the giv|en {\em |
|00000de0| 72 61 64 69 75 73 7d 20 | 61 6e 64 20 63 65 6e 74 |radius} |and cent|
|00000df0| 65 72 65 64 20 61 74 20 | 74 68 65 0a 09 67 69 76 |ered at |the..giv|
|00000e00| 65 6e 20 70 6f 73 69 74 | 69 6f 6e 2e 0a 5c 65 6e |en posit|ion..\en|
|00000e10| 64 7b 64 65 66 70 72 69 | 6d 7d 0a 4e 6f 74 65 20 |d{defpri|m}.Note |
|00000e20| 74 68 61 74 20 65 6c 6c | 69 70 73 6f 69 64 73 20 |that ell|ipsoids |
|00000e30| 6d 61 79 20 62 65 20 63 | 72 65 61 74 65 64 20 62 |may be c|reated b|
|00000e40| 79 20 61 70 70 6c 79 69 | 6e 67 20 74 68 65 20 70 |y applyi|ng the p|
|00000e50| 72 6f 70 65 72 20 73 63 | 61 6c 69 6e 67 0a 74 6f |roper sc|aling.to|
|00000e60| 20 61 20 73 70 68 65 72 | 65 2e 20 20 49 6e 76 65 | a spher|e. Inve|
|00000e70| 72 73 65 20 6d 61 70 70 | 69 6e 67 20 6f 6e 20 74 |rse mapp|ing on t|
|00000e80| 68 65 20 73 70 68 65 72 | 65 20 69 73 20 61 63 63 |he spher|e is acc|
|00000e90| 6f 6d 70 6c 69 73 68 65 | 64 0a 62 79 20 63 6f 6d |omplishe|d.by com|
|00000ea0| 70 75 74 69 6e 67 20 74 | 68 65 20 6c 6f 6e 67 69 |puting t|he longi|
|00000eb0| 74 75 64 65 20 61 6e 64 | 20 6c 61 74 69 74 75 64 |tude and| latitud|
|00000ec0| 65 20 6f 66 20 74 68 65 | 20 70 6f 69 6e 74 20 6f |e of the| point o|
|00000ed0| 6e 20 74 68 65 20 73 70 | 68 65 72 65 2c 0a 77 69 |n the sp|here,.wi|
|00000ee0| 74 68 20 74 68 65 20 24 | 75 24 20 76 61 6c 75 65 |th the $|u$ value|
|00000ef0| 20 63 6f 72 72 65 73 70 | 6f 6e 64 69 6e 67 20 74 | corresp|onding t|
|00000f00| 6f 20 6c 6f 6e 67 69 74 | 75 64 65 20 61 6e 64 20 |o longit|ude and |
|00000f10| 24 76 24 20 74 6f 20 6c | 61 74 69 74 75 64 65 2e |$v$ to l|atitude.|
|00000f20| 0a 4f 6e 20 61 6e 20 75 | 6e 74 72 61 6e 73 66 6f |.On an u|ntransfo|
|00000f30| 72 6d 65 64 20 73 70 68 | 65 72 65 2c 20 74 68 65 |rmed sph|ere, the|
|00000f40| 20 24 7a 24 20 61 78 69 | 73 20 64 65 66 69 6e 65 | $z$ axi|s define|
|00000f50| 73 20 74 68 65 20 70 6f | 6c 65 73 2c 20 61 6e 64 |s the po|les, and|
|00000f60| 20 74 68 65 0a 24 78 24 | 20 61 78 69 73 20 69 6e | the.$x$| axis in|
|00000f70| 74 65 72 73 65 63 74 73 | 20 74 68 65 20 73 70 68 |tersects| the sph|
|00000f80| 65 72 65 20 61 74 20 24 | 75 20 3d 20 30 24 2c 20 |ere at $|u = 0$, |
|00000f90| 24 76 20 3d 20 30 2e 35 | 24 2e 20 20 54 68 65 72 |$v = 0.5|$. Ther|
|00000fa0| 65 20 61 72 65 0a 64 65 | 67 65 6e 65 72 61 63 69 |e are.de|generaci|
|00000fb0| 65 73 20 61 74 20 74 68 | 65 20 70 6f 6c 65 73 3a |es at th|e poles:|
|00000fc0| 20 74 68 65 20 73 6f 75 | 74 68 20 70 6f 6c 65 20 | the sou|th pole |
|00000fd0| 63 6f 6e 74 61 69 6e 73 | 20 61 6c 6c 20 70 6f 69 |contains| all poi|
|00000fe0| 6e 74 73 20 6f 66 0a 6c | 61 74 69 74 75 64 65 20 |nts of.l|atitude |
|00000ff0| 30 2e 2c 20 74 68 65 20 | 6e 6f 72 74 68 20 61 6c |0., the |north al|
|00001000| 6c 20 70 6f 69 6e 74 73 | 20 6f 66 20 6c 61 74 69 |l points| of lati|
|00001010| 74 75 64 65 20 31 2e 0a | 0a 5c 62 65 67 69 6e 7b |tude 1..|.\begin{|
|00001020| 64 65 66 70 72 69 6d 7d | 7b 74 6f 72 75 73 7d 7b |defprim}|{torus}{|
|00001030| 7b 5c 65 6d 20 72 6d 61 | 6a 6f 72 20 72 6d 69 6e |{\em rma|jor rmin|
|00001040| 6f 72 7d 20 5c 65 76 65 | 63 7b 63 65 6e 74 65 72 |or} \eve|c{center|
|00001050| 7d 20 5c 65 76 65 63 7b | 75 70 7d 7d 0a 09 43 72 |} \evec{|up}}..Cr|
|00001060| 65 61 74 65 73 20 61 20 | 74 6f 72 75 73 20 63 65 |eates a |torus ce|
|00001070| 6e 74 65 72 65 64 20 61 | 74 20 5c 65 76 65 63 7b |ntered a|t \evec{|
|00001080| 63 65 6e 74 65 72 7d 20 | 62 79 20 72 6f 74 61 74 |center} |by rotat|
|00001090| 69 6e 67 0a 09 61 20 63 | 69 72 63 6c 65 20 77 69 |ing..a c|ircle wi|
|000010a0| 74 68 20 74 68 65 20 67 | 69 76 65 6e 20 6d 69 6e |th the g|iven min|
|000010b0| 6f 72 20 72 61 64 69 75 | 73 20 61 72 6f 75 6e 64 |or radiu|s around|
|000010c0| 20 74 68 65 20 63 65 6e | 74 65 72 0a 09 70 6f 69 | the cen|ter..poi|
|000010d0| 6e 74 20 61 74 20 61 20 | 64 69 73 74 61 6e 63 65 |nt at a |distance|
|000010e0| 20 65 71 75 61 6c 20 74 | 6f 20 74 68 65 20 6d 61 | equal t|o the ma|
|000010f0| 6a 6f 72 20 72 61 64 69 | 75 73 2e 20 0a 5c 65 6e |jor radi|us. .\en|
|00001100| 64 7b 64 65 66 70 72 69 | 6d 7d 0a 49 6e 20 74 6f |d{defpri|m}.In to|
|00001110| 72 69 20 69 6e 76 65 72 | 73 65 20 6d 61 70 70 69 |ri inver|se mappi|
|00001120| 6e 67 2c 0a 74 68 65 20 | 24 75 24 20 76 61 6c 75 |ng,.the |$u$ valu|
|00001130| 65 20 69 73 20 63 6f 6d | 70 75 74 65 64 20 75 73 |e is com|puted us|
|00001140| 69 6e 67 20 74 68 65 20 | 61 6e 67 6c 65 20 6f 66 |ing the |angle of|
|00001150| 20 72 6f 74 61 74 69 6f | 6e 20 61 62 6f 75 74 20 | rotatio|n about |
|00001160| 74 68 65 0a 75 70 20 76 | 65 63 74 6f 72 2c 20 61 |the.up v|ector, a|
|00001170| 6e 64 20 74 68 65 20 24 | 76 24 20 76 61 6c 75 65 |nd the $|v$ value|
|00001180| 20 69 73 20 63 6f 6d 70 | 75 74 69 6e 67 20 74 68 | is comp|uting th|
|00001190| 65 20 61 6e 67 6c 65 20 | 6f 66 20 72 6f 74 61 74 |e angle |of rotat|
|000011a0| 69 6f 6e 0a 61 72 6f 75 | 6e 64 20 74 68 65 20 74 |ion.arou|nd the t|
|000011b0| 75 62 65 2c 20 77 69 74 | 68 20 24 76 3d 30 24 20 |ube, wit|h $v=0$ |
|000011c0| 6f 63 63 75 72 69 6e 67 | 20 6f 6e 20 74 68 65 20 |occuring| on the |
|000011d0| 69 6e 6e 65 72 6d 6f 73 | 74 20 70 6f 69 6e 74 20 |innermos|t point |
|000011e0| 6f 66 20 74 68 65 20 74 | 75 62 65 2e 0a 0a 5c 62 |of the t|ube...\b|
|000011f0| 65 67 69 6e 7b 64 65 66 | 70 72 69 6d 7d 7b 74 72 |egin{def|prim}{tr|
|00001200| 69 61 6e 67 6c 65 7d 7b | 5c 65 76 65 63 7b 70 31 |iangle}{|\evec{p1|
|00001210| 7d 20 5c 65 76 65 63 7b | 70 32 7d 20 5c 65 76 65 |} \evec{|p2} \eve|
|00001220| 63 7b 70 33 7d 7d 0a 09 | 43 72 65 61 74 65 73 20 |c{p3}}..|Creates |
|00001230| 61 20 74 72 69 61 6e 67 | 6c 65 20 77 69 74 68 20 |a triang|le with |
|00001240| 74 68 65 20 67 69 76 65 | 6e 20 76 65 72 74 69 63 |the give|n vertic|
|00001250| 65 73 2e 0a 5c 65 6e 64 | 7b 64 65 66 70 72 69 6d |es..\end|{defprim|
|00001260| 7d 0a 0a 5c 62 65 67 69 | 6e 7b 64 65 66 70 72 69 |}..\begi|n{defpri|
|00001270| 6d 7d 7b 74 72 69 61 6e | 67 6c 65 7d 7b 5c 65 76 |m}{trian|gle}{\ev|
|00001280| 65 63 7b 70 31 7d 20 5c | 65 76 65 63 7b 6e 31 7d |ec{p1} \|evec{n1}|
|00001290| 20 5c 65 76 65 63 7b 70 | 32 7d 20 5c 65 76 65 63 | \evec{p|2} \evec|
|000012a0| 7b 6e 32 7d 0a 09 5c 65 | 76 65 63 7b 70 33 7d 20 |{n2}..\e|vec{p3} |
|000012b0| 5c 65 76 65 63 7b 6e 33 | 7d 7d 0a 09 43 72 65 61 |\evec{n3|}}..Crea|
|000012c0| 74 65 73 20 61 20 50 68 | 6f 6e 67 2d 73 68 61 64 |tes a Ph|ong-shad|
|000012d0| 65 64 20 74 72 69 61 6e | 67 6c 65 20 77 69 74 68 |ed trian|gle with|
|000012e0| 20 74 68 65 20 67 69 76 | 65 6e 20 76 65 72 74 69 | the giv|en verti|
|000012f0| 63 65 73 20 61 6e 64 0a | 09 76 65 72 74 65 78 20 |ces and.|.vertex |
|00001300| 6e 6f 72 6d 61 6c 73 2e | 0a 5c 65 6e 64 7b 64 65 |normals.|.\end{de|
|00001310| 66 70 72 69 6d 7d 0a 46 | 6f 72 20 62 6f 74 68 20 |fprim}.F|or both |
|00001320| 50 68 6f 6e 67 2d 20 61 | 6e 64 20 66 6c 61 74 2d |Phong- a|nd flat-|
|00001330| 73 68 61 64 65 64 20 74 | 72 69 61 6e 67 6c 65 73 |shaded t|riangles|
|00001340| 2c 20 74 68 65 20 24 75 | 24 20 61 78 69 73 20 69 |, the $u|$ axis i|
|00001350| 73 20 74 68 65 0a 76 65 | 63 74 6f 72 20 66 72 6f |s the.ve|ctor fro|
|00001360| 6d 20 5c 65 76 65 63 7b | 70 31 7d 20 74 6f 20 5c |m \evec{|p1} to \|
|00001370| 65 76 65 63 7b 70 32 7d | 2c 20 61 6e 64 20 74 68 |evec{p2}|, and th|
|00001380| 65 20 24 76 24 20 61 78 | 69 73 20 74 68 65 20 76 |e $v$ ax|is the v|
|00001390| 65 63 74 6f 72 0a 66 72 | 6f 6d 20 5c 65 76 65 63 |ector.fr|om \evec|
|000013a0| 7b 70 31 7d 20 74 6f 20 | 5c 65 76 65 63 7b 70 33 |{p1} to |\evec{p3|
|000013b0| 7d 2e 20 20 54 68 65 72 | 65 20 69 73 20 61 20 64 |}. Ther|e is a d|
|000013c0| 65 67 65 6e 65 72 61 63 | 79 20 61 74 0a 5c 65 76 |egenerac|y at.\ev|
|000013d0| 65 63 7b 70 33 7d 2c 20 | 77 68 69 63 68 20 63 6f |ec{p3}, |which co|
|000013e0| 6e 74 61 69 6e 73 20 61 | 6c 6c 20 70 6f 69 6e 74 |ntains a|ll point|
|000013f0| 73 20 77 69 74 68 20 24 | 76 20 3d 20 31 2e 30 24 |s with $|v = 1.0$|
|00001400| 2e 20 20 54 68 69 73 20 | 64 65 66 61 75 6c 74 0a |. This |default.|
|00001410| 6d 61 70 70 69 6e 67 20 | 6d 61 79 20 62 65 20 6d |mapping |may be m|
|00001420| 6f 64 69 66 69 65 64 20 | 75 73 69 6e 67 20 74 68 |odified |using th|
|00001430| 65 20 7b 5c 74 74 20 74 | 72 69 61 6e 67 6c 65 75 |e {\tt t|riangleu|
|00001440| 76 7d 20 70 72 69 6d 69 | 74 69 76 65 20 64 65 73 |v} primi|tive des|
|00001450| 63 72 69 62 65 64 0a 62 | 65 6c 6f 77 2e 0a 0a 5c |cribed.b|elow...\|
|00001460| 62 65 67 69 6e 7b 64 65 | 66 70 72 69 6d 7d 7b 74 |begin{de|fprim}{t|
|00001470| 72 69 61 6e 67 6c 65 75 | 76 7d 7b 5c 65 76 65 63 |riangleu|v}{\evec|
|00001480| 7b 70 31 7d 20 5c 65 76 | 65 63 7b 6e 31 7d 20 5c |{p1} \ev|ec{n1} \|
|00001490| 65 76 65 63 7b 75 76 31 | 7d 0a 20 20 5c 65 76 65 |evec{uv1|}. \eve|
|000014a0| 63 7b 70 32 7d 20 5c 65 | 76 65 63 7b 6e 32 7d 20 |c{p2} \e|vec{n2} |
|000014b0| 5c 65 76 65 63 7b 75 76 | 32 7d 0a 20 20 5c 65 76 |\evec{uv|2}. \ev|
|000014c0| 65 63 7b 70 33 7d 20 5c | 65 76 65 63 7b 6e 33 7d |ec{p3} \|evec{n3}|
|000014d0| 20 5c 65 76 65 63 7b 75 | 76 33 7d 7d 0a 09 43 72 | \evec{u|v3}}..Cr|
|000014e0| 65 61 74 65 73 20 61 20 | 50 68 6f 6e 67 2d 73 68 |eates a |Phong-sh|
|000014f0| 61 64 65 64 20 74 72 69 | 61 6e 67 6c 65 20 77 69 |aded tri|angle wi|
|00001500| 74 68 20 74 68 65 20 67 | 69 76 65 6e 20 76 65 72 |th the g|iven ver|
|00001510| 74 69 63 65 73 2c 0a 09 | 76 65 72 74 65 78 20 6e |tices,..|vertex n|
|00001520| 6f 72 6d 61 6c 73 2e 20 | 20 57 68 65 6e 20 70 65 |ormals. | When pe|
|00001530| 72 66 6f 72 6d 69 6e 67 | 20 74 65 78 74 75 72 69 |rforming| texturi|
|00001540| 6e 67 2c 20 74 68 65 0a | 09 7b 5c 65 6d 20 75 76 |ng, the.|.{\em uv|
|00001550| 7d 20 67 69 76 65 6e 20 | 66 6f 72 20 65 61 63 68 |} given |for each|
|00001560| 20 76 65 72 74 65 78 20 | 61 72 65 20 75 73 65 64 | vertex |are used|
|00001570| 20 69 6e 73 74 65 61 64 | 20 6f 66 20 74 68 65 0a | instead| of the.|
|00001580| 09 64 65 66 61 75 6c 74 | 20 76 61 6c 75 65 73 2e |.default| values.|
|00001590| 0a 5c 65 6e 64 7b 64 65 | 66 70 72 69 6d 7d 0a 57 |.\end{de|fprim}.W|
|000015a0| 68 65 6e 20 63 6f 6d 70 | 75 74 69 6e 67 20 24 75 |hen comp|uting $u|
|000015b0| 76 24 20 63 6f 6f 72 64 | 69 6e 61 74 65 73 20 77 |v$ coord|inates w|
|000015c0| 69 74 68 69 6e 20 74 68 | 65 20 69 6e 74 65 72 69 |ithin th|e interi|
|000015d0| 6f 72 20 6f 66 20 74 68 | 65 0a 74 72 69 61 6e 67 |or of th|e.triang|
|000015e0| 6c 65 2c 20 6c 69 6e 65 | 61 72 20 69 6e 74 65 72 |le, line|ar inter|
|000015f0| 70 6f 6c 61 74 69 6f 6e | 20 6f 66 20 74 68 65 20 |polation| of the |
|00001600| 63 6f 6f 72 64 69 6e 61 | 74 65 73 20 61 73 73 6f |coordina|tes asso|
|00001610| 63 69 61 74 65 64 20 77 | 69 74 68 0a 65 61 63 68 |ciated w|ith.each|
|00001620| 20 74 72 69 61 6e 67 6c | 65 20 76 65 72 74 65 78 | triangl|e vertex|
|00001630| 20 69 73 20 75 73 65 64 | 2e 0a 0a 5c 62 65 67 69 | is used|...\begi|
|00001640| 6e 7b 64 65 66 70 72 69 | 6d 7d 7b 70 6f 6c 79 7d |n{defpri|m}{poly}|
|00001650| 7b 5c 65 76 65 63 7b 70 | 31 7d 20 5c 65 76 65 63 |{\evec{p|1} \evec|
|00001660| 7b 70 32 7d 20 5c 65 76 | 65 63 7b 70 33 7d 20 5b |{p2} \ev|ec{p3} [|
|00001670| 5c 65 76 65 63 7b 70 34 | 7d 20 5c 6c 64 6f 74 73 |\evec{p4|} \ldots|
|00001680| 20 5d 7d 0a 09 43 72 65 | 61 74 65 73 20 61 20 70 | ]}..Cre|ates a p|
|00001690| 6f 6c 79 67 6f 6e 20 77 | 69 74 68 20 74 68 65 20 |olygon w|ith the |
|000016a0| 67 69 76 65 6e 20 76 65 | 72 74 69 63 65 73 2e 20 |given ve|rtices. |
|000016b0| 54 68 65 20 76 65 72 74 | 69 63 65 73 0a 09 73 68 |The vert|ices..sh|
|000016c0| 6f 75 6c 64 20 62 65 20 | 67 69 76 65 6e 20 69 6e |ould be |given in|
|000016d0| 20 63 6f 75 6e 74 65 72 | 2d 63 6c 6f 63 6b 77 69 | counter|-clockwi|
|000016e0| 73 65 20 6f 72 64 65 72 | 20 61 73 20 6f 6e 65 20 |se order| as one |
|000016f0| 69 73 0a 09 6c 6f 6f 6b | 69 6e 67 20 61 74 20 74 |is..look|ing at t|
|00001700| 68 65 20 60 60 66 72 6f | 6e 74 27 27 20 73 69 64 |he ``fro|nt'' sid|
|00001710| 65 20 6f 66 20 74 68 65 | 20 70 6f 6c 79 67 6f 6e |e of the| polygon|
|00001720| 2e 20 20 54 68 65 20 6e | 75 6d 62 65 72 20 6f 66 |. The n|umber of|
|00001730| 0a 09 76 65 72 74 69 63 | 65 73 20 69 6e 20 61 20 |..vertic|es in a |
|00001740| 70 6f 6c 79 67 6f 6e 20 | 69 73 20 6c 69 6d 69 74 |polygon |is limit|
|00001750| 65 64 20 6f 6e 6c 79 20 | 62 79 20 61 76 61 69 6c |ed only |by avail|
|00001760| 61 62 6c 65 20 6d 65 6d | 6f 72 79 2e 0a 5c 65 6e |able mem|ory..\en|
|00001770| 64 7b 64 65 66 70 72 69 | 6d 7d 0a 49 6e 76 65 72 |d{defpri|m}.Inver|
|00001780| 73 65 20 6d 61 70 70 69 | 6e 67 20 66 6f 72 20 61 |se mappi|ng for a|
|00001790| 72 62 69 74 72 61 72 79 | 20 70 6f 6c 79 67 6f 6e |rbitrary| polygon|
|000017a0| 73 20 69 73 20 70 72 6f | 62 6c 65 6d 61 74 69 63 |s is pro|blematic|
|000017b0| 61 6c 2e 0a 7b 5c 52 61 | 79 73 68 61 64 65 7d 0a |al..{\Ra|yshade}.|
|000017c0| 70 75 6e 74 73 20 61 6e | 64 20 65 71 75 61 74 65 |punts an|d equate|
|000017d0| 73 20 24 75 24 20 77 69 | 74 68 20 74 68 65 20 24 |s $u$ wi|th the $|
|000017e0| 78 24 20 63 6f 6f 72 64 | 69 6e 61 74 65 20 6f 66 |x$ coord|inate of|
|000017f0| 20 74 68 65 20 70 6f 69 | 6e 74 20 6f 66 20 69 6e | the poi|nt of in|
|00001800| 74 65 72 73 65 63 74 69 | 6f 6e 2c 0a 61 6e 64 20 |tersecti|on,.and |
|00001810| 24 76 24 20 77 69 74 68 | 20 74 68 65 20 24 79 24 |$v$ with| the $y$|
|00001820| 20 63 6f 6f 72 64 69 6e | 61 74 65 2e 0a 0a 5c 62 | coordin|ate...\b|
|00001830| 65 67 69 6e 7b 64 65 66 | 70 72 69 6d 7d 7b 68 65 |egin{def|prim}{he|
|00001840| 69 67 68 74 66 69 65 6c | 64 7d 7b 7b 5c 65 6d 20 |ightfiel|d}{{\em |
|00001850| 66 69 6c 65 7d 7d 0a 09 | 43 72 65 61 74 65 73 20 |file}}..|Creates |
|00001860| 61 20 68 65 69 67 68 74 | 20 66 69 65 6c 64 20 64 |a height| field d|
|00001870| 65 66 69 6e 65 64 20 62 | 79 20 74 68 65 20 61 6c |efined b|y the al|
|00001880| 74 69 74 75 64 65 20 64 | 61 74 61 20 73 74 6f 72 |titude d|ata stor|
|00001890| 65 64 0a 09 69 6e 20 74 | 68 65 20 6e 61 6d 65 64 |ed..in t|he named|
|000018a0| 20 7b 5c 65 6d 20 66 69 | 6c 65 7d 2e 20 20 54 68 | {\em fi|le}. Th|
|000018b0| 65 20 68 65 69 67 68 74 | 20 66 69 65 6c 64 20 69 |e height| field i|
|000018c0| 73 20 62 61 73 65 64 20 | 75 70 6f 6e 0a 09 70 65 |s based |upon..pe|
|000018d0| 72 74 75 72 62 61 74 69 | 6f 6e 73 20 6f 66 20 74 |rturbati|ons of t|
|000018e0| 68 65 20 75 6e 69 74 20 | 73 71 75 61 72 65 20 69 |he unit |square i|
|000018f0| 6e 20 74 68 65 20 24 7a | 3d 30 24 20 70 6c 61 6e |n the $z|=0$ plan|
|00001900| 65 2c 20 61 6e 64 20 69 | 73 0a 09 72 65 6e 64 65 |e, and i|s..rende|
|00001910| 72 65 64 20 61 73 20 61 | 20 73 75 72 66 61 63 65 |red as a| surface|
|00001920| 20 74 65 73 73 65 6c 6c | 61 74 65 64 20 62 79 20 | tessell|ated by |
|00001930| 72 69 67 68 74 20 69 73 | 6f 73 63 65 6c 65 73 20 |right is|osceles |
|00001940| 74 72 69 61 6e 67 6c 65 | 73 2e 0a 5c 65 6e 64 7b |triangle|s..\end{|
|00001950| 64 65 66 70 72 69 6d 7d | 0a 53 65 65 20 41 70 70 |defprim}|.See App|
|00001960| 65 6e 64 69 78 20 43 20 | 66 6f 72 20 61 20 64 69 |endix C |for a di|
|00001970| 73 63 75 73 73 69 6f 6e | 20 6f 66 20 74 68 65 20 |scussion| of the |
|00001980| 66 6f 72 6d 61 74 20 6f | 66 20 61 20 68 65 69 67 |format o|f a heig|
|00001990| 68 74 20 66 69 65 6c 64 | 20 66 69 6c 65 2e 0a 48 |ht field| file..H|
|000019a0| 65 69 67 68 74 20 66 69 | 65 6c 64 20 69 6e 76 65 |eight fi|eld inve|
|000019b0| 72 73 65 20 6d 61 70 70 | 69 6e 67 20 69 73 20 73 |rse mapp|ing is s|
|000019c0| 74 72 61 69 67 68 74 2d | 66 6f 72 77 61 72 64 3a |traight-|forward:|
|000019d0| 20 20 24 75 24 20 69 73 | 20 74 68 65 0a 24 78 24 | $u$ is| the.$x$|
|000019e0| 20 63 6f 6f 72 64 69 6e | 61 74 65 20 6f 66 20 74 | coordin|ate of t|
|000019f0| 68 65 20 70 6f 69 6e 74 | 20 6f 66 20 69 6e 74 65 |he point| of inte|
|00001a00| 72 73 65 63 74 69 6f 6e | 2c 20 24 76 24 20 74 68 |rsection|, $v$ th|
|00001a10| 65 20 24 79 24 20 63 6f | 6f 72 64 69 6e 61 74 65 |e $y$ co|ordinate|
|00001a20| 2e 0a 0a 5c 62 65 67 69 | 6e 7b 64 65 66 70 72 69 |...\begi|n{defpri|
|00001a30| 6d 7d 7b 70 6c 61 6e 65 | 7d 7b 5c 65 76 65 63 7b |m}{plane|}{\evec{|
|00001a40| 70 6f 69 6e 74 7d 20 5c | 65 76 65 63 7b 6e 6f 72 |point} \|evec{nor|
|00001a50| 6d 61 6c 7d 7d 0a 09 43 | 72 65 61 74 65 73 20 61 |mal}}..C|reates a|
|00001a60| 20 70 6c 61 6e 65 20 74 | 68 61 74 20 70 61 73 73 | plane t|hat pass|
|00001a70| 65 73 20 74 68 72 6f 75 | 67 68 20 74 68 65 20 67 |es throu|gh the g|
|00001a80| 69 76 65 6e 20 70 6f 69 | 6e 74 20 61 6e 64 0a 09 |iven poi|nt and..|
|00001a90| 68 61 73 20 74 68 65 20 | 73 70 65 63 69 66 69 65 |has the |specifie|
|00001aa0| 64 20 6e 6f 72 6d 61 6c | 2e 0a 5c 65 6e 64 7b 64 |d normal|..\end{d|
|00001ab0| 65 66 70 72 69 6d 7d 0a | 49 6e 76 65 72 73 65 20 |efprim}.|Inverse |
|00001ac0| 6d 61 70 70 69 6e 67 20 | 6f 6e 20 74 68 65 20 70 |mapping |on the p|
|00001ad0| 6c 61 6e 65 20 69 73 20 | 69 64 65 6e 74 69 63 61 |lane is |identica|
|00001ae0| 6c 20 74 6f 20 70 6f 6c | 79 67 6f 6e 61 6c 20 69 |l to pol|ygonal i|
|00001af0| 6e 76 65 72 73 65 20 6d | 61 70 70 69 6e 67 2e 0a |nverse m|apping..|
|00001b00| 0a 5c 62 65 67 69 6e 7b | 64 65 66 70 72 69 6d 7d |.\begin{|defprim}|
|00001b10| 7b 63 79 6c 69 6e 64 65 | 72 7d 7b 7b 5c 65 6d 20 |{cylinde|r}{{\em |
|00001b20| 72 61 64 69 75 73 7d 20 | 5c 65 76 65 63 7b 62 6f |radius} |\evec{bo|
|00001b30| 74 74 6f 6d 7d 20 5c 65 | 76 65 63 7b 74 6f 70 7d |ttom} \e|vec{top}|
|00001b40| 7d 0a 09 43 72 65 61 74 | 65 73 20 61 20 63 79 6c |}..Creat|es a cyl|
|00001b50| 69 6e 64 65 72 20 74 68 | 61 74 20 65 78 74 65 6e |inder th|at exten|
|00001b60| 64 73 20 66 72 6f 6d 20 | 5c 65 76 65 63 7b 62 6f |ds from |\evec{bo|
|00001b70| 74 74 6f 6d 7d 20 74 6f | 20 5c 65 76 65 63 7b 74 |ttom} to| \evec{t|
|00001b80| 6f 70 7d 0a 09 61 6e 64 | 20 68 61 73 20 74 68 65 |op}..and| has the|
|00001b90| 20 69 6e 64 69 63 61 74 | 65 64 20 7b 5c 65 6d 20 | indicat|ed {\em |
|00001ba0| 72 61 64 69 75 73 7d 2e | 20 20 43 79 6c 69 6e 64 |radius}.| Cylind|
|00001bb0| 65 72 73 20 61 72 65 20 | 72 65 6e 64 65 72 65 64 |ers are |rendered|
|00001bc0| 0a 09 7b 5c 65 6d 20 77 | 69 74 68 6f 75 74 7d 20 |..{\em w|ithout} |
|00001bd0| 65 6e 64 63 61 70 73 2e | 0a 5c 65 6e 64 7b 64 65 |endcaps.|.\end{de|
|00001be0| 66 70 72 69 6d 7d 0a 54 | 68 65 20 63 79 6c 69 6e |fprim}.T|he cylin|
|00001bf0| 64 65 72 27 73 20 61 78 | 69 73 20 64 65 66 69 6e |der's ax|is defin|
|00001c00| 65 73 20 74 68 65 20 24 | 76 24 20 61 78 69 73 2e |es the $|v$ axis.|
|00001c10| 20 20 54 68 65 20 24 75 | 24 20 61 78 69 73 20 77 | The $u|$ axis w|
|00001c20| 72 61 70 73 20 61 72 6f | 75 6e 64 20 74 68 65 0a |raps aro|und the.|
|00001c30| 63 79 6c 69 6e 64 65 72 | 2c 20 77 69 74 68 20 24 |cylinder|, with $|
|00001c40| 75 3d 30 24 20 64 65 70 | 65 6e 64 65 6e 74 20 75 |u=0$ dep|endent u|
|00001c50| 70 6f 6e 20 74 68 65 20 | 6f 72 69 65 6e 74 61 74 |pon the |orientat|
|00001c60| 69 6f 6e 20 6f 66 20 74 | 68 65 20 63 79 6c 69 6e |ion of t|he cylin|
|00001c70| 64 65 72 2e 0a 0a 0a 5c | 62 65 67 69 6e 7b 64 65 |der....\|begin{de|
|00001c80| 66 70 72 69 6d 7d 7b 63 | 6f 6e 65 7d 7b 24 72 61 |fprim}{c|one}{$ra|
|00001c90| 64 5f 7b 62 6f 74 74 6f | 6d 7d 24 20 5c 65 76 65 |d_{botto|m}$ \eve|
|00001ca0| 63 7b 62 6f 74 74 6f 6d | 7d 20 24 72 61 64 5f 7b |c{bottom|} $rad_{|
|00001cb0| 74 6f 70 7d 24 20 5c 65 | 76 65 63 7b 74 6f 70 7d |top}$ \e|vec{top}|
|00001cc0| 7d 0a 09 43 72 65 61 74 | 73 20 61 20 28 74 72 75 |}..Creat|s a (tru|
|00001cd0| 6e 63 61 74 65 64 29 20 | 63 6f 6e 65 20 74 68 61 |ncated) |cone tha|
|00001ce0| 74 20 65 78 74 65 6e 64 | 73 20 66 72 6f 6d 20 5c |t extend|s from \|
|00001cf0| 65 76 65 63 7b 62 6f 74 | 74 6f 6d 7d 20 74 6f 0a |evec{bot|tom} to.|
|00001d00| 09 5c 65 76 65 63 7b 74 | 6f 70 7d 2e 20 20 54 68 |.\evec{t|op}. Th|
|00001d10| 65 20 63 6f 6e 65 20 77 | 69 6c 6c 20 68 61 76 65 |e cone w|ill have|
|00001d20| 20 61 20 72 61 64 69 75 | 73 20 6f 66 20 24 72 61 | a radiu|s of $ra|
|00001d30| 64 5f 7b 62 6f 74 74 6f | 6d 7d 24 20 61 74 0a 09 |d_{botto|m}$ at..|
|00001d40| 5c 65 76 65 63 7b 62 6f | 74 74 6f 6d 7d 20 61 6e |\evec{bo|ttom} an|
|00001d50| 64 20 61 20 72 61 64 69 | 75 73 20 6f 66 20 24 72 |d a radi|us of $r|
|00001d60| 61 64 5f 7b 74 6f 70 7d | 24 20 61 74 20 5c 65 76 |ad_{top}|$ at \ev|
|00001d70| 65 63 7b 74 6f 70 7d 2e | 0a 09 43 6f 6e 65 73 20 |ec{top}.|..Cones |
|00001d80| 61 72 65 20 72 65 6e 64 | 65 72 65 64 20 7b 5c 65 |are rend|ered {\e|
|00001d90| 6d 20 77 69 74 68 6f 75 | 74 7d 20 65 6e 64 63 61 |m withou|t} endca|
|00001da0| 70 73 2e 0a 5c 65 6e 64 | 7b 64 65 66 70 72 69 6d |ps..\end|{defprim|
|00001db0| 7d 0a 43 6f 6e 65 20 69 | 6e 76 65 72 73 65 20 6d |}.Cone i|nverse m|
|00001dc0| 61 70 70 69 6e 67 20 69 | 73 20 61 6e 61 6c 6f 67 |apping i|s analog|
|00001dd0| 6f 75 73 20 74 6f 20 63 | 79 6c 69 6e 64 65 72 20 |ous to c|ylinder |
|00001de0| 6d 61 70 70 69 6e 67 2e | 0a 0a 5c 62 65 67 69 6e |mapping.|..\begin|
|00001df0| 7b 64 65 66 70 72 69 6d | 7d 7b 64 69 73 63 7d 7b |{defprim|}{disc}{|
|00001e00| 7b 5c 65 6d 20 72 61 64 | 69 75 73 7d 20 5c 65 76 |{\em rad|ius} \ev|
|00001e10| 65 63 7b 70 6f 73 7d 20 | 5c 65 76 65 63 7b 6e 6f |ec{pos} |\evec{no|
|00001e20| 72 6d 61 6c 7d 7d 0a 09 | 43 72 65 61 74 65 73 20 |rmal}}..|Creates |
|00001e30| 61 20 64 69 73 63 20 63 | 65 6e 74 65 72 65 64 20 |a disc c|entered |
|00001e40| 61 74 20 74 68 65 20 67 | 69 76 65 6e 20 70 6f 73 |at the g|iven pos|
|00001e50| 69 74 69 6f 6e 20 61 6e | 64 20 77 69 74 68 20 74 |ition an|d with t|
|00001e60| 68 65 0a 09 69 6e 64 69 | 63 61 74 65 64 20 73 75 |he..indi|cated su|
|00001e70| 72 66 61 63 65 20 6e 6f | 72 6d 61 6c 2e 0a 5c 65 |rface no|rmal..\e|
|00001e80| 6e 64 7b 64 65 66 70 72 | 69 6d 7d 0a 44 69 73 63 |nd{defpr|im}.Disc|
|00001e90| 73 20 61 72 65 20 75 73 | 65 66 75 6c 20 66 6f 72 |s are us|eful for|
|00001ea0| 20 70 6c 61 63 69 6e 67 | 0a 65 6e 64 63 61 70 73 | placing|.endcaps|
|00001eb0| 20 6f 6e 20 63 79 6c 69 | 6e 64 65 72 73 20 61 6e | on cyli|nders an|
|00001ec0| 64 20 63 6f 6e 65 73 2e | 0a 49 6e 76 65 72 73 65 |d cones.|.Inverse|
|00001ed0| 20 6d 61 70 70 69 6e 67 | 20 66 6f 72 20 74 68 65 | mapping| for the|
|00001ee0| 20 64 69 73 63 20 69 73 | 20 62 61 73 65 64 20 6f | disc is| based o|
|00001ef0| 6e 20 74 68 65 20 63 6f | 6d 70 75 74 61 74 69 6f |n the co|mputatio|
|00001f00| 6e 20 6f 66 20 74 68 65 | 0a 6e 6f 72 6d 61 6c 69 |n of the|.normali|
|00001f10| 7a 65 64 20 70 6f 6c 61 | 72 20 63 6f 6f 72 64 69 |zed pola|r coordi|
|00001f20| 6e 61 74 65 73 20 6f 66 | 20 74 68 65 20 70 6f 69 |nates of| the poi|
|00001f30| 6e 74 20 6f 66 20 69 6e | 74 65 72 73 65 63 74 69 |nt of in|tersecti|
|00001f40| 6f 6e 2e 20 20 54 68 65 | 0a 6e 6f 72 6d 61 6c 69 |on. The|.normali|
|00001f50| 7a 65 64 20 72 61 64 69 | 75 73 0a 6f 66 20 74 68 |zed radi|us.of th|
|00001f60| 65 20 70 6f 69 6e 74 20 | 6f 66 20 69 6e 74 65 72 |e point |of inter|
|00001f70| 73 65 63 74 69 6f 6e 20 | 69 73 20 61 73 73 69 67 |section |is assig|
|00001f80| 6e 65 64 20 74 6f 20 24 | 75 24 2c 20 77 68 69 6c |ned to $|u$, whil|
|00001f90| 65 20 74 68 65 20 6e 6f | 72 6d 61 6c 69 7a 65 64 |e the no|rmalized|
|00001fa0| 20 61 6e 67 6c 65 0a 66 | 72 6f 6d 20 61 20 72 65 | angle.f|rom a re|
|00001fb0| 66 65 72 65 6e 63 65 20 | 76 65 63 74 6f 72 20 69 |ference |vector i|
|00001fc0| 73 20 61 73 73 69 67 6e | 65 64 20 74 6f 20 24 76 |s assign|ed to $v|
|00001fd0| 24 2e 0a 0a 5c 73 65 63 | 74 69 6f 6e 7b 41 67 67 |$...\sec|tion{Agg|
|00001fe0| 72 65 67 61 74 65 20 4f | 62 6a 65 63 74 73 7d 0a |regate O|bjects}.|
|00001ff0| 0a 41 6e 20 61 67 67 72 | 65 67 61 74 65 20 69 73 |.An aggr|egate is|
|00002000| 20 61 20 63 6f 6c 6c 65 | 63 74 69 6f 6e 20 6f 66 | a colle|ction of|
|00002010| 20 70 72 69 6d 69 74 69 | 76 65 73 2c 20 61 67 67 | primiti|ves, agg|
|00002020| 72 65 67 61 74 65 2c 20 | 61 6e 64 20 43 53 47 0a |regate, |and CSG.|
|00002030| 6f 62 6a 65 63 74 73 2e | 20 20 41 6e 20 61 67 67 |objects.| An agg|
|00002040| 72 65 67 61 74 65 2c 20 | 6f 6e 63 65 20 64 65 66 |regate, |once def|
|00002050| 69 6e 65 64 2c 20 6d 61 | 79 20 62 65 20 69 6e 73 |ined, ma|y be ins|
|00002060| 74 61 6e 74 69 61 74 65 | 64 20 61 74 20 77 69 6c |tantiate|d at wil|
|00002070| 6c 2c 0a 77 68 69 63 68 | 20 6d 65 61 6e 73 20 74 |l,.which| means t|
|00002080| 68 61 74 0a 63 6f 70 69 | 65 73 20 74 68 61 74 20 |hat.copi|es that |
|00002090| 61 72 65 20 6f 70 74 69 | 6f 6e 61 6c 6c 79 20 74 |are opti|onally t|
|000020a0| 72 61 6e 73 66 6f 72 6d | 65 64 20 61 6e 64 20 74 |ransform|ed and t|
|000020b0| 65 78 74 75 72 65 64 20 | 6d 61 79 20 62 65 20 6d |extured |may be m|
|000020c0| 61 64 65 2e 0a 49 66 20 | 61 20 73 63 65 6e 65 20 |ade..If |a scene |
|000020d0| 63 61 6c 6c 73 20 66 6f | 72 20 74 68 65 20 70 72 |calls fo|r the pr|
|000020e0| 65 73 65 6e 63 65 20 6f | 66 20 6d 61 6e 79 20 67 |esence o|f many g|
|000020f0| 65 6f 6d 65 74 72 69 63 | 61 6c 6c 79 20 69 64 65 |eometric|ally ide|
|00002100| 6e 74 69 63 61 6c 0a 6f | 62 6a 65 63 74 73 2c 20 |ntical.o|bjects, |
|00002110| 6f 6e 6c 79 20 6f 6e 65 | 20 73 75 63 68 20 6f 62 |only one| such ob|
|00002120| 6a 65 63 74 20 6e 65 65 | 64 20 62 65 20 64 65 66 |ject nee|d be def|
|00002130| 69 6e 65 64 3b 20 74 68 | 65 20 6f 6e 65 20 64 65 |ined; th|e one de|
|00002140| 66 69 6e 65 64 20 6f 62 | 6a 65 63 74 0a 6d 61 79 |fined ob|ject.may|
|00002150| 20 74 68 65 6e 20 62 65 | 20 69 6e 73 74 61 6e 74 | then be| instant|
|00002160| 69 61 74 65 64 20 6d 61 | 6e 79 20 74 69 6d 65 73 |iated ma|ny times|
|00002170| 2e 0a 0a 41 6e 20 61 67 | 67 72 65 67 61 74 65 20 |...An ag|gregate |
|00002180| 69 73 20 6f 6e 65 20 6f | 66 20 73 65 76 65 72 61 |is one o|f severa|
|00002190| 6c 20 70 6f 73 73 69 62 | 6c 65 20 74 79 70 65 73 |l possib|le types|
|000021a0| 2e 20 20 54 68 65 73 65 | 20 61 67 67 72 65 67 61 |. These| aggrega|
|000021b0| 74 65 20 74 79 70 65 73 | 0a 61 72 65 20 64 69 66 |te types|.are dif|
|000021c0| 66 65 72 65 6e 74 69 61 | 74 65 64 20 62 79 20 74 |ferentia|ted by t|
|000021d0| 68 65 20 74 79 70 65 20 | 6f 66 20 72 61 79 2f 61 |he type |of ray/a|
|000021e0| 67 67 72 65 67 61 74 65 | 20 69 6e 74 65 72 73 65 |ggregate| interse|
|000021f0| 63 74 69 6f 6e 20 61 6c | 67 6f 72 69 74 68 6d 0a |ction al|gorithm.|
|00002200| 28 6f 66 74 65 6e 20 74 | 65 72 6d 65 64 20 61 6e |(often t|ermed an|
|00002210| 20 7b 5c 65 6d 20 61 63 | 63 65 6c 65 72 61 74 69 | {\em ac|celerati|
|00002220| 6f 6e 20 74 65 63 68 6e | 69 71 75 65 7d 20 6f 72 |on techn|ique} or|
|00002230| 20 7b 5c 65 6d 20 65 66 | 66 69 63 69 65 6e 63 79 | {\em ef|ficiency|
|00002240| 20 73 63 68 65 6d 65 7d | 29 0a 74 68 61 74 20 69 | scheme}|).that i|
|00002250| 73 20 75 73 65 64 2e 0a | 0a 41 67 67 72 65 67 61 |s used..|.Aggrega|
|00002260| 74 65 73 20 61 72 65 20 | 64 65 66 69 6e 65 64 20 |tes are |defined |
|00002270| 62 79 20 67 69 76 69 6e | 67 20 61 20 6b 65 79 77 |by givin|g a keyw|
|00002280| 6f 72 64 20 74 68 61 74 | 20 64 65 66 69 6e 65 73 |ord that| defines|
|00002290| 20 74 68 65 0a 74 79 70 | 65 20 6f 66 20 74 68 65 | the.typ|e of the|
|000022a0| 20 61 67 67 72 65 67 61 | 74 65 2c 20 66 6f 6c 6c | aggrega|te, foll|
|000022b0| 6f 77 65 64 20 62 79 0a | 61 20 73 65 72 69 65 73 |owed by.|a series|
|000022c0| 20 6f 66 20 6f 62 6a 65 | 63 74 20 69 6e 73 74 61 | of obje|ct insta|
|000022d0| 6e 74 69 61 74 69 6f 6e | 73 20 61 6e 64 0a 73 75 |ntiation|s and.su|
|000022e0| 72 66 61 63 65 20 64 65 | 66 69 6e 69 74 69 6f 6e |rface de|finition|
|000022f0| 73 2c 20 61 6e 64 20 74 | 65 72 6d 69 6e 61 74 65 |s, and t|erminate|
|00002300| 64 20 75 73 69 6e 67 20 | 74 68 65 20 7b 5c 74 74 |d using |the {\tt|
|00002310| 20 65 6e 64 7d 20 6b 65 | 79 77 6f 72 64 2e 0a 49 | end} ke|yword..I|
|00002320| 66 20 61 20 64 65 66 69 | 6e 65 64 20 6f 62 6a 65 |f a defi|ned obje|
|00002330| 63 74 20 63 6f 6e 74 61 | 69 6e 73 20 6e 6f 20 69 |ct conta|ins no i|
|00002340| 6e 73 74 61 6e 74 69 61 | 74 69 6f 6e 73 2c 20 61 |nstantia|tions, a|
|00002350| 20 77 61 72 6e 69 6e 67 | 20 6d 65 73 73 61 67 65 | warning| message|
|00002360| 0a 69 73 20 70 72 69 6e | 74 65 64 2e 0a 0a 54 68 |.is prin|ted...Th|
|00002370| 65 20 6d 6f 73 74 20 62 | 61 73 69 63 20 74 79 70 |e most b|asic typ|
|00002380| 65 20 6f 66 20 61 67 67 | 72 65 67 61 74 65 2c 20 |e of agg|regate, |
|00002390| 74 68 65 20 7b 5c 65 6d | 20 6c 69 73 74 7d 2c 20 |the {\em| list}, |
|000023a0| 70 65 72 66 6f 72 6d 73 | 0a 69 6e 74 65 72 73 65 |performs|.interse|
|000023b0| 63 74 69 6f 6e 20 74 65 | 73 74 69 6e 67 20 69 6e |ction te|sting in|
|000023c0| 20 74 68 65 20 73 69 6d | 70 6c 65 73 74 20 70 6f | the sim|plest po|
|000023d0| 73 73 69 62 6c 65 20 77 | 61 79 3a 20 20 45 61 63 |ssible w|ay: Eac|
|000023e0| 68 20 6f 62 6a 65 63 74 | 20 69 6e 20 74 68 65 0a |h object| in the.|
|000023f0| 6c 69 73 74 20 69 73 20 | 74 65 73 74 65 64 20 66 |list is |tested f|
|00002400| 6f 72 20 69 6e 74 65 72 | 73 65 63 74 69 6f 6e 20 |or inter|section |
|00002410| 77 69 74 68 20 74 68 65 | 20 72 61 79 20 69 6e 20 |with the| ray in |
|00002420| 74 75 72 6e 2c 20 61 6e | 64 20 74 68 65 20 63 6c |turn, an|d the cl|
|00002430| 6f 73 65 73 74 0a 69 6e | 74 65 72 73 65 63 74 69 |osest.in|tersecti|
|00002440| 6f 6e 20 69 73 20 72 65 | 74 75 72 6e 65 64 2e 0a |on is re|turned..|
|00002450| 0a 5c 62 65 67 69 6e 7b | 64 65 66 6b 65 79 7d 7b |.\begin{|defkey}{|
|00002460| 6c 69 73 74 7d 7b 5c 6c | 64 6f 74 73 20 7b 5c 74 |list}{\l|dots {\t|
|00002470| 74 20 65 6e 64 7d 7d 0a | 09 43 72 65 61 74 65 20 |t end}}.|.Create |
|00002480| 61 20 4c 69 73 74 20 6f | 62 6a 65 63 74 20 63 6f |a List o|bject co|
|00002490| 6e 74 61 69 6e 69 6e 67 | 20 74 68 6f 73 65 20 6f |ntaining| those o|
|000024a0| 62 6a 65 63 74 73 20 69 | 6e 73 74 61 6e 74 69 61 |bjects i|nstantia|
|000024b0| 74 65 64 20 62 65 74 77 | 65 65 6e 0a 09 74 68 65 |ted betw|een..the|
|000024c0| 20 7b 5c 74 74 20 6c 69 | 73 74 7d 2f 7b 5c 74 74 | {\tt li|st}/{\tt|
|000024d0| 20 65 6e 64 7d 20 70 61 | 69 72 2e 0a 5c 65 6e 64 | end} pa|ir..\end|
|000024e0| 7b 64 65 66 6b 65 79 7d | 0a 0a 54 68 65 20 7b 5c |{defkey}|..The {\|
|000024f0| 65 6d 20 67 72 69 64 7d | 20 61 67 67 72 65 67 61 |em grid}| aggrega|
|00002500| 74 65 0a 64 69 76 69 64 | 65 73 20 74 68 65 20 72 |te.divid|es the r|
|00002510| 65 67 69 6f 6e 20 6f 66 | 20 73 70 61 63 65 20 69 |egion of| space i|
|00002520| 74 20 6f 63 63 75 70 69 | 65 73 20 69 6e 74 6f 20 |t occupi|es into |
|00002530| 61 20 6e 75 6d 62 65 72 | 20 6f 66 20 64 69 73 63 |a number| of disc|
|00002540| 72 65 74 65 0a 62 6f 78 | 2d 73 68 61 70 65 64 0a |rete.box|-shaped.|
|00002550| 76 6f 78 65 6c 73 2e 20 | 20 45 61 63 68 20 6f 66 |voxels. | Each of|
|00002560| 20 74 68 65 73 65 20 76 | 6f 78 65 6c 73 20 63 6f | these v|oxels co|
|00002570| 6e 74 61 69 6e 73 20 61 | 20 6c 69 73 74 20 6f 66 |ntains a| list of|
|00002580| 20 74 68 65 20 6f 62 6a | 65 63 74 73 20 74 68 61 | the obj|ects tha|
|00002590| 74 0a 69 6e 74 65 72 73 | 65 63 74 20 74 68 65 20 |t.inters|ect the |
|000025a0| 76 6f 78 65 6c 2e 20 20 | 54 68 69 73 20 64 69 73 |voxel. |This dis|
|000025b0| 63 72 65 74 69 7a 61 74 | 69 6f 6e 20 6d 61 6b 65 |cretizat|ion make|
|000025c0| 73 20 69 74 20 70 6f 73 | 73 69 62 6c 65 20 74 6f |s it pos|sible to|
|000025d0| 0a 72 65 73 74 72 69 63 | 74 20 74 68 65 20 6f 62 |.restric|t the ob|
|000025e0| 6a 65 63 74 73 0a 74 65 | 73 74 65 64 20 66 6f 72 |jects.te|sted for|
|000025f0| 20 69 6e 74 65 72 73 65 | 63 74 69 6f 6e 20 74 6f | interse|ction to|
|00002600| 20 74 68 6f 73 65 20 74 | 68 61 74 20 61 72 65 20 | those t|hat are |
|00002610| 6c 69 6b 65 6c 79 20 74 | 6f 20 68 69 74 20 74 68 |likely t|o hit th|
|00002620| 65 20 72 61 79 2c 0a 61 | 6e 64 20 74 6f 20 74 65 |e ray,.a|nd to te|
|00002630| 73 74 0a 74 68 65 20 6f | 62 6a 65 63 74 73 20 69 |st.the o|bjects i|
|00002640| 6e 20 6e 65 61 72 6c 79 | 20 60 60 63 6c 6f 73 65 |n nearly| ``close|
|00002650| 73 74 2d 66 69 72 73 74 | 27 27 20 6f 72 64 65 72 |st-first|'' order|
|00002660| 2e 0a 0a 5c 62 65 67 69 | 6e 7b 64 65 66 6b 65 79 |...\begi|n{defkey|
|00002670| 7d 7b 67 72 69 64 7d 7b | 7b 5c 65 6d 20 78 76 6f |}{grid}{|{\em xvo|
|00002680| 78 20 79 76 6f 78 20 7a | 76 6f 78 7d 20 5c 6c 64 |x yvox z|vox} \ld|
|00002690| 6f 74 73 20 7b 5c 74 74 | 20 65 6e 64 7d 7d 0a 09 |ots {\tt| end}}..|
|000026a0| 43 72 65 61 74 65 20 61 | 20 47 72 69 64 20 6f 62 |Create a| Grid ob|
|000026b0| 6a 65 63 74 73 20 63 6f | 6d 70 6f 73 65 64 20 6f |jects co|mposed o|
|000026c0| 66 20 7b 5c 65 6d 20 78 | 76 6f 78 7d 20 62 79 20 |f {\em x|vox} by |
|000026d0| 7b 5c 65 6d 20 79 76 6f | 78 7d 20 62 79 0a 09 7b |{\em yvo|x} by..{|
|000026e0| 5c 65 6d 20 7a 76 6f 78 | 7d 20 76 6f 78 65 6c 73 |\em zvox|} voxels|
|000026f0| 20 63 6f 6e 74 61 69 6e | 69 6e 67 20 74 68 6f 73 | contain|ing thos|
|00002700| 65 20 6f 62 6a 65 63 74 | 73 0a 09 69 6e 73 74 61 |e object|s..insta|
|00002710| 6e 74 69 61 74 65 64 20 | 62 65 74 77 65 65 6e 20 |ntiated |between |
|00002720| 74 68 65 20 7b 5c 74 74 | 20 67 72 69 64 7d 2f 7b |the {\tt| grid}/{|
|00002730| 5c 74 74 20 65 6e 64 7d | 20 70 61 69 72 2e 0a 5c |\tt end}| pair..\|
|00002740| 65 6e 64 7b 64 65 66 6b | 65 79 7d 0a 49 74 20 69 |end{defk|ey}.It i|
|00002750| 73 20 75 73 75 61 6c 6c | 79 20 6f 6e 6c 79 20 77 |s usuall|y only w|
|00002760| 6f 72 74 68 77 68 69 6c | 65 20 74 6f 20 60 60 65 |orthwhil|e to ``e|
|00002770| 6e 67 72 69 64 27 27 20 | 72 61 74 68 65 72 20 6c |ngrid'' |rather l|
|00002780| 61 72 67 65 2c 0a 63 6f | 6d 70 6c 65 78 20 63 6f |arge,.co|mplex co|
|00002790| 6c 6c 65 63 74 69 6f 6e | 73 20 6f 66 20 6f 62 6a |llection|s of obj|
|000027a0| 65 63 74 73 2e 20 20 47 | 72 69 64 73 20 61 6c 73 |ects. G|rids als|
|000027b0| 6f 20 75 73 65 20 61 20 | 67 72 65 61 74 20 64 65 |o use a |great de|
|000027c0| 61 6c 20 6d 6f 72 65 0a | 6d 65 6d 6f 72 79 20 74 |al more.|memory t|
|000027d0| 68 61 6e 20 4c 69 73 74 | 20 6f 62 6a 65 63 74 73 |han List| objects|
|000027e0| 2e 0a 0a 5c 73 65 63 74 | 69 6f 6e 20 7b 43 6f 6e |...\sect|ion {Con|
|000027f0| 73 74 72 75 63 74 69 76 | 65 20 53 6f 6c 69 64 20 |structiv|e Solid |
|00002800| 47 65 6f 6d 65 74 72 79 | 7d 0a 0a 43 6f 6e 73 74 |Geometry|}..Const|
|00002810| 72 75 63 74 69 76 65 20 | 53 6f 6c 69 64 20 47 65 |ructive |Solid Ge|
|00002820| 6f 6d 65 74 72 79 20 69 | 73 0a 74 68 65 20 70 72 |ometry i|s.the pr|
|00002830| 6f 63 65 73 73 20 6f 66 | 20 62 75 69 6c 64 69 6e |ocess of| buildin|
|00002840| 67 20 73 6f 6c 69 64 20 | 6f 62 6a 65 63 74 73 20 |g solid |objects |
|00002850| 66 72 6f 6d 20 6f 74 68 | 65 72 20 73 6f 6c 69 64 |from oth|er solid|
|00002860| 73 2e 0a 54 68 65 20 74 | 68 72 65 65 20 43 53 47 |s..The t|hree CSG|
|00002870| 0a 6f 70 65 72 61 74 6f | 72 73 20 61 72 65 20 55 |.operato|rs are U|
|00002880| 6e 69 6f 6e 2c 20 49 6e | 74 65 72 73 65 63 74 69 |nion, In|tersecti|
|00002890| 6f 6e 2c 20 61 6e 64 20 | 44 69 66 66 65 72 65 6e |on, and |Differen|
|000028a0| 63 65 2e 20 20 45 61 63 | 68 20 6f 70 65 72 61 74 |ce. Eac|h operat|
|000028b0| 6f 72 0a 61 63 74 73 20 | 75 70 6f 6e 20 74 77 6f |or.acts |upon two|
|000028c0| 20 6f 62 6a 65 63 74 73 | 20 61 6e 64 20 70 72 6f | objects| and pro|
|000028d0| 64 75 63 65 73 20 61 20 | 73 69 6e 67 6c 65 20 6f |duces a |single o|
|000028e0| 62 6a 65 63 74 20 72 65 | 73 75 6c 74 2e 0a 42 79 |bject re|sult..By|
|000028f0| 20 63 6f 6d 62 69 6e 69 | 6e 67 20 6d 75 6c 74 69 | combini|ng multi|
|00002900| 70 6c 65 20 6c 65 76 65 | 6c 73 20 6f 66 20 43 53 |ple leve|ls of CS|
|00002910| 47 20 6f 70 65 72 61 74 | 6f 72 73 2c 20 63 6f 6d |G operat|ors, com|
|00002920| 70 6c 65 78 0a 6f 62 6a | 65 63 74 73 20 63 61 6e |plex.obj|ects can|
|00002930| 20 62 65 20 70 72 6f 64 | 75 63 65 64 20 66 72 6f | be prod|uced fro|
|00002940| 6d 20 73 69 6d 70 6c 65 | 20 70 72 69 6d 69 74 69 |m simple| primiti|
|00002950| 76 65 73 2e 0a 0a 54 68 | 65 20 75 6e 69 6f 6e 20 |ves...Th|e union |
|00002960| 6f 66 20 74 77 6f 20 6f | 62 6a 65 63 74 73 20 72 |of two o|bjects r|
|00002970| 65 73 75 6c 74 73 20 69 | 6e 20 61 6e 0a 6f 62 6a |esults i|n an.obj|
|00002980| 65 63 74 20 74 68 61 74 | 20 65 6e 63 6c 6f 73 65 |ect that| enclose|
|00002990| 73 20 74 68 65 20 73 70 | 61 63 65 20 6f 63 63 75 |s the sp|ace occu|
|000029a0| 70 69 65 64 20 62 79 20 | 74 68 65 20 74 77 6f 20 |pied by |the two |
|000029b0| 67 69 76 65 6e 20 6f 62 | 6a 65 63 74 73 2e 0a 49 |given ob|jects..I|
|000029c0| 6e 74 65 72 73 65 63 74 | 69 6f 6e 20 72 65 73 75 |ntersect|ion resu|
|000029d0| 6c 74 73 20 69 6e 20 61 | 6e 20 6f 62 6a 65 63 74 |lts in a|n object|
|000029e0| 20 74 68 61 74 20 65 6e | 63 6c 6f 73 65 73 20 74 | that en|closes t|
|000029f0| 68 65 20 73 70 61 63 65 | 20 77 68 65 72 65 20 74 |he space| where t|
|00002a00| 68 65 20 74 77 6f 0a 67 | 69 76 65 6e 20 6f 62 6a |he two.g|iven obj|
|00002a10| 65 63 74 73 20 6f 76 65 | 72 6c 61 70 2e 20 20 44 |ects ove|rlap. D|
|00002a20| 69 66 66 65 72 65 6e 63 | 65 20 69 73 20 61 6e 20 |ifferenc|e is an |
|00002a30| 6f 72 64 65 72 20 64 65 | 70 65 6e 64 65 6e 74 20 |order de|pendent |
|00002a40| 6f 70 65 72 61 74 6f 72 | 3b 20 69 74 0a 72 65 73 |operator|; it.res|
|00002a50| 75 6c 74 73 20 69 6e 20 | 74 68 65 0a 66 69 72 73 |ults in |the.firs|
|00002a60| 74 20 67 69 76 65 6e 20 | 6f 62 6a 65 63 74 20 6d |t given |object m|
|00002a70| 69 6e 75 73 20 74 68 65 | 20 73 70 61 63 65 20 77 |inus the| space w|
|00002a80| 68 65 72 65 20 74 68 65 | 20 73 65 63 6f 6e 64 20 |here the| second |
|00002a90| 69 6e 74 65 72 73 65 63 | 74 65 64 0a 74 68 65 20 |intersec|ted.the |
|00002aa0| 66 69 72 73 74 2e 0a 0a | 5c 73 75 62 73 65 63 74 |first...|\subsect|
|00002ab0| 69 6f 6e 7b 43 53 47 20 | 69 6e 20 7b 5c 52 61 79 |ion{CSG |in {\Ray|
|00002ac0| 73 68 61 64 65 7d 7d 0a | 0a 43 53 47 20 69 6e 20 |shade}}.|.CSG in |
|00002ad0| 7b 5c 72 61 79 73 68 61 | 64 65 7d 20 77 69 6c 6c |{\raysha|de} will|
|00002ae0| 20 67 65 6e 65 72 61 6c | 6c 79 20 6f 70 65 72 61 | general|ly opera|
|00002af0| 74 65 20 70 72 6f 70 65 | 72 6c 79 20 77 68 65 6e |te prope|rly when|
|00002b00| 20 61 70 70 6c 69 65 64 | 20 74 6f 0a 63 6f 6e 6a | applied| to.conj|
|00002b10| 75 6e 63 74 69 6f 6e 20 | 77 69 74 68 0a 6f 6e 20 |unction |with.on |
|00002b20| 62 6f 78 65 73 2c 20 73 | 70 68 65 72 65 73 2c 0a |boxes, s|pheres,.|
|00002b30| 74 6f 72 69 2c 20 61 6e | 64 20 62 6c 6f 62 73 2e |tori, an|d blobs.|
|00002b40| 0a 54 68 65 73 65 20 70 | 72 69 6d 69 74 69 76 65 |.These p|rimitive|
|00002b50| 73 20 61 72 65 20 62 79 | 20 6e 61 74 75 72 65 20 |s are by| nature |
|00002b60| 63 6f 6e 73 69 73 74 65 | 6e 74 2c 20 61 73 20 74 |consiste|nt, as t|
|00002b70| 68 65 79 20 61 6c 6c 0a | 65 6e 63 6c 6f 73 65 20 |hey all.|enclose |
|00002b80| 61 20 70 6f 72 74 69 6f | 6e 20 6f 66 20 73 70 61 |a portio|n of spa|
|00002b90| 63 65 20 28 6e 6f 20 68 | 6f 6c 65 20 66 72 6f 6d |ce (no h|ole from|
|00002ba0| 20 74 68 65 20 60 60 69 | 6e 73 69 64 65 27 27 20 | the ``i|nside'' |
|00002bb0| 74 6f 20 74 68 65 0a 60 | 60 6f 75 74 73 69 64 65 |to the.`|`outside|
|00002bc0| 27 27 29 2c 20 68 61 76 | 65 20 73 75 72 66 61 63 |''), hav|e surfac|
|00002bd0| 65 20 6e 6f 72 6d 61 6c | 73 20 77 68 69 63 68 20 |e normal|s which |
|00002be0| 70 6f 69 6e 74 20 6f 75 | 74 77 61 72 64 20 28 74 |point ou|tward (t|
|00002bf0| 68 65 79 0a 61 72 65 20 | 6e 6f 74 20 60 60 69 6e |hey.are |not ``in|
|00002c00| 73 69 64 65 2d 6f 75 74 | 27 27 29 2c 20 61 6e 64 |side-out|''), and|
|00002c10| 20 64 6f 20 6e 6f 74 20 | 68 61 76 65 20 61 6e 79 | do not |have any|
|00002c20| 20 65 78 74 72 61 6e 65 | 6f 75 73 20 73 75 72 66 | extrane|ous surf|
|00002c30| 61 63 65 73 2e 0a 0a 43 | 53 47 20 6f 62 6a 65 63 |aces...C|SG objec|
|00002c40| 74 73 20 6d 61 79 20 61 | 6c 73 6f 20 62 65 20 63 |ts may a|lso be c|
|00002c50| 6f 6e 73 74 72 75 63 74 | 65 64 20 66 72 6f 6d 20 |onstruct|ed from |
|00002c60| 61 67 67 72 65 67 61 74 | 65 20 6f 62 6a 65 63 74 |aggregat|e object|
|00002c70| 73 2e 0a 54 68 65 73 65 | 20 61 67 67 72 65 67 61 |s..These| aggrega|
|00002c80| 74 65 73 20 63 6f 6e 74 | 61 69 6e 0a 77 68 61 74 |tes cont|ain.what|
|00002c90| 65 76 65 72 20 69 73 20 | 6c 69 73 74 65 64 20 69 |ever is |listed i|
|00002ca0| 6e 73 69 64 65 2c 20 61 | 6e 64 20 6d 61 79 20 74 |nside, a|nd may t|
|00002cb0| 68 65 72 65 66 6f 72 65 | 20 62 65 20 69 6e 63 6f |herefore| be inco|
|00002cc0| 6e 73 69 73 74 65 6e 74 | 2e 0a 46 6f 72 20 65 78 |nsistent|..For ex|
|00002cd0| 61 6d 70 6c 65 2c 20 61 | 6e 20 6f 62 6a 65 63 74 |ample, a|n object|
|00002ce0| 20 77 68 69 63 68 20 63 | 6f 6e 74 61 69 6e 73 20 | which c|ontains |
|00002cf0| 61 20 73 69 6e 67 6c 65 | 20 74 72 69 61 6e 67 6c |a single| triangl|
|00002d00| 65 20 77 69 6c 6c 20 6e | 6f 74 0a 70 72 6f 64 75 |e will n|ot.produ|
|00002d10| 63 65 20 63 6f 72 72 65 | 63 74 20 72 65 73 75 6c |ce corre|ct resul|
|00002d20| 74 73 20 69 6e 20 43 53 | 47 20 6d 6f 64 65 6c 73 |ts in CS|G models|
|00002d30| 2c 20 62 65 63 61 75 73 | 65 20 74 68 65 20 74 72 |, becaus|e the tr|
|00002d40| 69 61 6e 67 6c 65 20 64 | 6f 65 73 20 6e 6f 74 20 |iangle d|oes not |
|00002d50| 65 6e 63 6c 6f 73 65 0a | 73 70 61 63 65 2e 20 20 |enclose.|space. |
|00002d60| 48 6f 77 65 76 65 72 2c | 20 61 20 63 6f 6c 6c 65 |However,| a colle|
|00002d70| 63 74 69 6f 6e 20 6f 66 | 20 66 6f 75 72 20 74 72 |ction of| four tr|
|00002d80| 69 61 6e 67 6c 65 73 20 | 77 68 69 63 68 20 66 6f |iangles |which fo|
|00002d90| 72 6d 20 61 20 70 79 72 | 61 6d 69 64 0a 64 6f 65 |rm a pyr|amid.doe|
|00002da0| 73 20 65 6e 63 6c 6f 73 | 65 20 73 70 61 63 65 2c |s enclos|e space,|
|00002db0| 20 61 6e 64 20 69 66 20 | 74 68 65 20 74 72 69 61 | and if |the tria|
|00002dc0| 6e 67 6c 65 20 6e 6f 72 | 6d 61 6c 73 0a 61 72 65 |ngle nor|mals.are|
|00002dd0| 20 6f 72 69 65 6e 74 65 | 64 20 63 6f 72 72 65 63 | oriente|d correc|
|00002de0| 74 6c 79 2c 0a 74 68 65 | 20 43 53 47 20 6f 70 65 |tly,.the| CSG ope|
|00002df0| 72 61 74 6f 72 73 20 73 | 68 6f 75 6c 64 20 77 6f |rators s|hould wo|
|00002e00| 72 6b 20 63 6f 72 72 65 | 63 74 6c 79 20 6f 6e 20 |rk corre|ctly on |
|00002e10| 74 68 65 20 70 79 72 61 | 6d 69 64 2e 0a 0a 43 53 |the pyra|mid...CS|
|00002e20| 47 20 6f 62 6a 65 63 74 | 73 20 61 72 65 20 73 70 |G object|s are sp|
|00002e30| 65 63 69 66 69 65 64 20 | 62 79 20 73 75 72 72 6f |ecified |by surro|
|00002e40| 75 6e 64 69 6e 67 20 74 | 68 65 20 6f 62 6a 65 63 |unding t|he objec|
|00002e50| 74 73 20 75 70 6f 6e 0a | 77 68 69 63 68 20 74 6f |ts upon.|which to|
|00002e60| 20 6f 70 65 72 61 74 65 | 2c 20 61 73 20 77 65 6c | operate|, as wel|
|00002e70| 6c 20 61 73 20 61 6e 79 | 20 61 73 73 6f 63 69 61 |l as any| associa|
|00002e80| 74 65 64 20 73 75 72 66 | 61 63 65 2d 62 69 6e 64 |ted surf|ace-bind|
|00002e90| 69 6e 67 20 63 6f 6d 6d | 61 6e 64 73 2c 0a 62 79 |ing comm|ands,.by|
|00002ea0| 20 74 68 65 20 6f 70 65 | 72 61 74 6f 72 20 76 65 | the ope|rator ve|
|00002eb0| 72 62 20 6f 6e 20 6f 6e | 65 20 73 69 64 65 20 61 |rb on on|e side a|
|00002ec0| 6e 64 20 74 68 65 20 7b | 5c 74 74 20 65 6e 64 7d |nd the {|\tt end}|
|00002ed0| 0a 6b 65 79 77 6f 72 64 | 20 6f 6e 20 74 68 65 20 |.keyword| on the |
|00002ee0| 6f 74 68 65 72 3a 0a 0a | 5c 62 65 67 69 6e 7b 64 |other:..|\begin{d|
|00002ef0| 65 66 6b 65 79 7d 7b 75 | 6e 69 6f 6e 7d 7b 24 3c |efkey}{u|nion}{$<|
|00002f00| 24 7b 5c 65 6d 20 4f 62 | 6a 65 63 74 7d 24 3e 24 |${\em Ob|ject}$>$|
|00002f10| 20 24 3c 24 7b 5c 65 6d | 20 4f 62 6a 65 63 74 7d | $<${\em| Object}|
|00002f20| 24 3e 24 0a 5b 24 3c 24 | 7b 5c 65 6d 20 4f 62 6a |$>$.[$<$|{\em Obj|
|00002f30| 65 63 74 7d 24 3e 24 20 | 5c 6c 64 6f 74 73 5d 20 |ect}$>$ |\ldots] |
|00002f40| 7b 5c 74 74 20 65 6e 64 | 7d 7d 0a 09 53 70 65 63 |{\tt end|}}..Spec|
|00002f50| 69 66 79 20 61 20 6e 65 | 77 20 6f 62 6a 65 63 74 |ify a ne|w object|
|00002f60| 20 64 65 66 69 6e 65 64 | 20 61 73 20 74 68 65 20 | defined| as the |
|00002f70| 75 6e 69 6f 6e 20 6f 66 | 20 74 68 65 0a 09 67 69 |union of| the..gi|
|00002f80| 76 65 6e 20 6f 62 6a 65 | 63 74 73 2e 0a 5c 65 6e |ven obje|cts..\en|
|00002f90| 64 7b 64 65 66 6b 65 79 | 7d 0a 0a 5c 62 65 67 69 |d{defkey|}..\begi|
|00002fa0| 6e 7b 64 65 66 6b 65 79 | 7d 7b 64 69 66 66 65 72 |n{defkey|}{differ|
|00002fb0| 65 6e 63 65 7d 7b 24 3c | 24 7b 5c 65 6d 20 4f 62 |ence}{$<|${\em Ob|
|00002fc0| 6a 65 63 74 7d 24 3e 24 | 20 24 3c 24 7b 5c 65 6d |ject}$>$| $<${\em|
|00002fd0| 20 4f 62 6a 65 63 74 7d | 24 3e 24 20 0a 5b 24 3c | Object}|$>$ .[$<|
|00002fe0| 24 7b 5c 65 6d 20 4f 62 | 6a 65 63 74 7d 24 3e 24 |${\em Ob|ject}$>$|
|00002ff0| 20 5c 6c 64 6f 74 73 5d | 20 7b 5c 74 74 20 65 6e | \ldots]| {\tt en|
|00003000| 64 7d 7d 0a 09 53 70 65 | 63 69 66 79 20 61 20 6e |d}}..Spe|cify a n|
|00003010| 65 77 20 6f 62 6a 65 63 | 74 20 64 65 66 69 6e 65 |ew objec|t define|
|00003020| 64 20 61 73 20 74 68 65 | 20 64 69 66 66 65 72 65 |d as the| differe|
|00003030| 6e 63 65 20 6f 66 20 74 | 68 65 0a 09 67 69 76 65 |nce of t|he..give|
|00003040| 6e 20 6f 62 6a 65 63 74 | 73 2e 0a 5c 65 6e 64 7b |n object|s..\end{|
|00003050| 64 65 66 6b 65 79 7d 0a | 0a 5c 62 65 67 69 6e 7b |defkey}.|.\begin{|
|00003060| 64 65 66 6b 65 79 7d 7b | 69 6e 74 65 72 73 65 63 |defkey}{|intersec|
|00003070| 74 7d 7b 24 3c 24 7b 5c | 65 6d 20 4f 62 6a 65 63 |t}{$<${\|em Objec|
|00003080| 74 7d 24 3e 24 20 24 3c | 24 7b 5c 65 6d 20 4f 62 |t}$>$ $<|${\em Ob|
|00003090| 6a 65 63 74 7d 24 3e 24 | 0a 5b 24 3c 24 7b 5c 65 |ject}$>$|.[$<${\e|
|000030a0| 6d 20 4f 62 6a 65 63 74 | 7d 24 3e 24 20 5c 6c 64 |m Object|}$>$ \ld|
|000030b0| 6f 74 73 5d 20 7b 5c 74 | 74 20 65 6e 64 7d 7d 0a |ots] {\t|t end}}.|
|000030c0| 09 53 70 65 63 69 66 79 | 20 61 20 6e 65 77 20 6f |.Specify| a new o|
|000030d0| 62 6a 65 63 74 20 64 65 | 66 69 6e 65 64 20 61 73 |bject de|fined as|
|000030e0| 20 74 68 65 20 69 6e 74 | 65 72 73 65 63 74 69 6f | the int|ersectio|
|000030f0| 6e 20 6f 66 20 74 68 65 | 0a 09 67 69 76 65 6e 20 |n of the|..given |
|00003100| 6f 62 6a 65 63 74 73 2e | 0a 5c 65 6e 64 7b 64 65 |objects.|.\end{de|
|00003110| 66 6b 65 79 7d 0a 0a 4e | 6f 74 65 20 74 68 61 74 |fkey}..N|ote that|
|00003120| 20 74 68 65 20 63 75 72 | 72 65 6e 74 20 69 6d 70 | the cur|rent imp|
|00003130| 6c 65 6d 65 6e 74 61 74 | 69 6f 6e 20 64 6f 65 73 |lementat|ion does|
|00003140| 20 6e 6f 74 20 73 75 70 | 70 6f 72 74 20 6d 6f 72 | not sup|port mor|
|00003150| 65 20 74 68 61 74 20 74 | 77 6f 0a 6f 62 6a 65 63 |e that t|wo.objec|
|00003160| 74 73 20 69 6e 20 61 20 | 43 53 47 20 6c 69 73 74 |ts in a |CSG list|
|00003170| 20 28 62 75 74 20 69 74 | 20 69 73 20 70 6c 61 6e | (but it| is plan|
|00003180| 6e 65 64 20 66 6f 72 20 | 61 20 66 75 74 75 72 65 |ned for |a future|
|00003190| 20 76 65 72 73 69 6f 6e | 29 2e 0a 0a 25 20 54 68 | version|)...% Th|
|000031a0| 65 20 66 6f 6c 6c 6f 77 | 69 6e 67 20 61 72 65 6e |e follow|ing aren|
|000031b0| 20 73 69 6d 70 6c 65 20 | 43 53 47 20 6f 62 6a 65 | simple |CSG obje|
|000031c0| 63 74 73 20 75 73 69 6e | 67 20 74 68 65 20 66 6f |cts usin|g the fo|
|000031d0| 75 72 20 63 6f 6e 73 69 | 73 74 65 6e 74 0a 25 20 |ur consi|stent.% |
|000031e0| 70 72 69 6d 69 74 69 76 | 65 73 3a 0a 25 20 0a 25 |primitiv|es:.% .%|
|000031f0| 20 75 6e 69 6f 6e 20 62 | 6f 78 20 2e 2e 2e 20 64 | union b|ox ... d|
|00003200| 69 66 66 65 72 65 6e 63 | 65 20 2e 2e 2e 0a 0a 5c |ifferenc|e .....\|
|00003210| 73 75 62 73 65 63 74 69 | 6f 6e 7b 50 6f 74 65 6e |subsecti|on{Poten|
|00003220| 74 69 61 6c 20 43 53 47 | 20 50 72 6f 62 6c 65 6d |tial CSG| Problem|
|00003230| 73 7d 0a 0a 41 20 63 6f | 6e 73 69 73 74 65 6e 74 |s}..A co|nsistent|
|00003240| 20 43 53 47 20 6d 6f 64 | 65 6c 20 69 73 20 6f 6e | CSG mod|el is on|
|00003250| 65 20 77 68 69 63 68 20 | 69 73 20 6d 61 64 65 0a |e which |is made.|
|00003260| 75 70 20 6f 66 20 73 6f | 6c 69 64 20 6f 62 6a 65 |up of so|lid obje|
|00003270| 63 74 73 20 77 69 74 68 | 20 6e 6f 20 64 61 6e 67 |cts with| no dang|
|00003280| 6c 69 6e 67 20 73 75 72 | 66 61 63 65 73 2e 20 20 |ling sur|faces. |
|00003290| 49 6e 20 7b 5c 72 61 79 | 73 68 61 64 65 7d 2c 0a |In {\ray|shade},.|
|000032a0| 69 74 20 69 73 20 71 75 | 69 74 65 20 65 61 73 79 |it is qu|ite easy|
|000032b0| 20 74 6f 20 63 6f 6e 73 | 74 72 75 63 74 20 69 6e | to cons|truct in|
|000032c0| 63 6f 6e 73 69 73 74 65 | 6e 74 20 6d 6f 64 65 6c |consiste|nt model|
|000032d0| 73 2c 20 77 68 69 63 68 | 20 77 69 6c 6c 20 75 73 |s, which| will us|
|000032e0| 75 61 6c 6c 79 0a 61 70 | 70 65 61 72 20 69 6e 63 |ually.ap|pear inc|
|000032f0| 6f 72 72 65 63 74 20 69 | 6e 20 74 68 65 20 66 69 |orrect i|n the fi|
|00003300| 6e 61 6c 20 69 6d 61 67 | 65 73 2e 0a 49 6e 20 7b |nal imag|es..In {|
|00003310| 5c 72 61 79 73 68 61 64 | 65 7d 2c 20 43 53 47 20 |\rayshad|e}, CSG |
|00003320| 69 73 20 69 6d 70 6c 65 | 6d 65 6e 74 65 64 20 62 |is imple|mented b|
|00003330| 79 20 6d 61 69 6e 74 61 | 69 6e 69 6e 67 0a 74 68 |y mainta|ining.th|
|00003340| 65 20 74 72 65 65 20 73 | 74 72 75 63 74 75 72 65 |e tree s|tructure|
|00003350| 20 6f 66 20 74 68 65 20 | 43 53 47 20 6f 70 65 72 | of the |CSG oper|
|00003360| 61 74 69 6f 6e 73 2e 20 | 20 54 68 69 73 20 74 72 |ations. | This tr|
|00003370| 65 65 20 69 73 20 74 72 | 61 76 65 72 73 65 64 2c |ee is tr|aversed,|
|00003380| 0a 61 6e 64 20 74 68 65 | 20 6f 70 65 72 61 74 6f |.and the| operato|
|00003390| 72 73 20 74 68 65 72 65 | 69 6e 20 61 70 70 6c 69 |rs there|in appli|
|000033a0| 65 64 2c 20 6f 6e 20 61 | 20 70 65 72 2d 72 61 79 |ed, on a| per-ray|
|000033b0| 20 62 61 73 69 73 2e 0a | 49 74 20 69 73 20 74 68 | basis..|It is th|
|000033c0| 65 72 65 66 6f 72 65 20 | 64 69 66 66 69 63 75 6c |erefore |difficul|
|000033d0| 74 20 74 6f 20 76 65 72 | 69 66 79 20 74 68 65 20 |t to ver|ify the |
|000033e0| 63 6f 6e 73 69 73 74 65 | 6e 63 79 20 6f 66 0a 74 |consiste|ncy of.t|
|000033f0| 68 65 20 6d 6f 64 65 6c | 20 60 60 6f 6e 20 74 68 |he model| ``on th|
|00003400| 65 20 66 6c 79 2e 27 27 | 0a 0a 4f 6e 65 20 63 6c |e fly.''|..One cl|
|00003410| 61 73 73 20 6f 66 20 43 | 53 47 20 70 72 6f 62 6c |ass of C|SG probl|
|00003420| 65 6d 73 20 6f 63 63 75 | 72 20 77 68 65 6e 0a 73 |ems occu|r when.s|
|00003430| 75 72 66 61 63 65 73 20 | 6f 66 20 6f 62 6a 65 63 |urfaces |of objec|
|00003440| 74 73 20 62 65 69 6e 67 | 20 6f 70 65 72 61 74 65 |ts being| operate|
|00003450| 64 20 75 70 6f 6e 0a 63 | 6f 69 6e 63 69 64 65 2e |d upon.c|oincide.|
|00003460| 20 20 46 6f 72 20 65 78 | 61 6d 70 6c 65 2c 20 77 | For ex|ample, w|
|00003470| 68 65 6e 20 73 75 62 74 | 72 61 63 74 69 6e 67 20 |hen subt|racting |
|00003480| 61 20 62 6f 78 20 66 72 | 6f 6d 20 61 6e 6f 74 68 |a box fr|om anoth|
|00003490| 65 72 20 62 6f 78 20 74 | 6f 20 6d 61 6b 65 20 61 |er box t|o make a|
|000034a0| 0a 73 71 75 61 72 65 20 | 63 75 70 2c 20 74 68 65 |.square |cup, the|
|000034b0| 20 72 65 73 75 6c 74 20 | 77 69 6c 6c 20 62 65 20 | result |will be |
|000034c0| 77 72 6f 6e 67 20 69 66 | 20 74 68 65 20 74 6f 70 |wrong if| the top|
|000034d0| 73 20 6f 66 20 74 68 65 | 20 74 77 6f 20 62 6f 78 |s of the| two box|
|000034e0| 65 73 0a 63 6f 69 6e 63 | 69 64 65 2e 20 20 54 6f |es.coinc|ide. To|
|000034f0| 20 63 6f 72 72 65 63 74 | 20 74 68 69 73 2c 20 74 | correct| this, t|
|00003500| 68 65 20 69 6e 6e 65 72 | 20 62 6f 78 20 73 68 6f |he inner| box sho|
|00003510| 75 6c 64 20 62 65 20 6d | 61 64 65 0a 73 6c 69 67 |uld be m|ade.slig|
|00003520| 68 74 6c 79 20 74 61 6c | 6c 65 72 20 74 68 61 6e |htly tal|ler than|
|00003530| 20 74 68 65 20 6f 75 74 | 65 72 20 62 6f 78 2e 0a | the out|er box..|
|00003540| 41 20 72 65 6c 61 74 65 | 64 20 70 72 6f 62 6c 65 |A relate|d proble|
|00003550| 6d 20 74 68 61 74 20 6d | 75 73 74 20 62 65 0a 61 |m that m|ust be.a|
|00003560| 76 6f 69 64 65 64 20 6f | 63 63 75 72 73 20 77 68 |voided o|ccurs wh|
|00003570| 65 6e 20 74 77 6f 20 63 | 6f 69 6e 63 69 64 65 6e |en two c|oinciden|
|00003580| 74 20 73 75 72 66 61 63 | 65 73 20 61 72 65 20 61 |t surfac|es are a|
|00003590| 73 73 69 67 6e 65 64 0a | 64 69 66 66 65 72 65 6e |ssigned.|differen|
|000035a0| 74 20 73 75 72 66 61 63 | 65 20 70 72 6f 70 65 72 |t surfac|e proper|
|000035b0| 74 69 65 73 2e 0a 0a 49 | 74 20 6d 61 79 20 73 65 |ties...I|t may se|
|000035c0| 65 6d 20 74 68 61 74 20 | 74 68 65 20 75 6e 69 6f |em that |the unio|
|000035d0| 6e 20 6f 70 65 72 61 74 | 6f 72 20 69 73 20 75 6e |n operat|or is un|
|000035e0| 6e 65 63 65 73 73 61 72 | 79 2c 20 73 69 6e 63 65 |necessar|y, since|
|000035f0| 0a 6c 69 73 74 69 6e 67 | 20 74 77 6f 20 6f 62 6a |.listing| two obj|
|00003600| 65 63 74 73 20 74 6f 67 | 65 74 68 65 72 20 69 6e |ects tog|ether in|
|00003610| 20 61 6e 20 61 67 67 72 | 65 67 61 74 65 20 72 65 | an aggr|egate re|
|00003620| 73 75 6c 74 73 0a 69 6e | 20 61 6e 20 69 6d 61 67 |sults.in| an imag|
|00003630| 65 20 74 68 61 74 20 61 | 70 70 65 61 72 73 20 74 |e that a|ppears t|
|00003640| 6f 20 62 65 20 74 68 65 | 20 73 61 6d 65 2e 0a 57 |o be the| same..W|
|00003650| 68 69 6c 65 20 74 68 65 | 20 72 65 73 75 6c 74 20 |hile the| result |
|00003660| 6f 66 20 73 75 63 68 20 | 61 20 73 68 6f 72 74 2d |of such |a short-|
|00003670| 63 75 74 0a 6d 61 79 20 | 61 70 70 65 61 72 20 74 |cut.may |appear t|
|00003680| 68 65 20 73 61 6d 65 20 | 6f 6e 20 74 68 65 20 65 |he same |on the e|
|00003690| 78 74 65 72 69 6f 72 2c | 20 74 68 65 20 69 6e 74 |xterior,| the int|
|000036a0| 65 72 69 6f 72 0a 6f 66 | 20 74 68 65 20 72 65 73 |erior.of| the res|
|000036b0| 75 6c 74 69 6e 67 20 6f | 62 6a 65 63 74 20 77 69 |ulting o|bject wi|
|000036c0| 6c 6c 20 63 6f 6e 74 61 | 69 6e 0a 65 78 74 72 61 |ll conta|in.extra|
|000036d0| 6e 65 6f 75 73 20 73 75 | 72 66 61 63 65 73 2e 0a |neous su|rfaces..|
|000036e0| 54 68 65 20 66 6f 6c 6c | 6f 77 69 6e 67 20 65 78 |The foll|owing ex|
|000036f0| 61 6d 70 6c 65 73 20 73 | 68 6f 77 20 74 68 69 73 |amples s|how this|
|00003700| 20 71 75 69 74 65 20 63 | 6c 65 61 72 6c 79 2e 0a | quite c|learly..|
|00003710| 0a 5c 62 65 67 69 6e 7b | 76 65 72 62 61 74 69 6d |.\begin{|verbatim|
|00003720| 7d 0a 20 20 20 20 64 69 | 66 66 65 72 65 6e 63 65 |}. di|fference|
|00003730| 0a 20 20 20 20 20 20 62 | 6f 78 20 2d 32 20 30 20 |. b|ox -2 0 |
|00003740| 2d 33 20 20 32 20 33 20 | 33 0a 20 20 20 20 20 20 |-3 2 3 |3. |
|00003750| 75 6e 69 6f 6e 20 20 2f | 2a 20 63 68 61 6e 67 65 |union /|* change|
|00003760| 20 74 6f 20 6c 69 73 74 | 3b 20 6e 6f 74 65 20 62 | to list|; note b|
|00003770| 61 64 20 69 6e 74 65 72 | 6e 61 6c 20 73 75 72 66 |ad inter|nal surf|
|00003780| 61 63 65 73 20 2a 2f 0a | 20 20 20 20 20 20 20 20 |aces */.| |
|00003790| 73 70 68 65 72 65 20 32 | 20 31 20 30 20 30 0a 20 |sphere 2| 1 0 0. |
|000037a0| 20 20 20 20 20 20 20 73 | 70 68 65 72 65 20 32 20 | s|phere 2 |
|000037b0| 2d 31 20 30 20 30 0a 20 | 20 20 20 20 20 65 6e 64 |-1 0 0. | end|
|000037c0| 0a 20 20 20 20 65 6e 64 | 20 72 6f 74 61 74 65 20 |. end| rotate |
|000037d0| 31 20 30 20 30 20 2d 34 | 30 20 20 72 6f 74 61 74 |1 0 0 -4|0 rotat|
|000037e0| 65 20 30 20 30 20 31 20 | 35 30 0a 5c 65 6e 64 7b |e 0 0 1 |50.\end{|
|000037f0| 76 65 72 62 61 74 69 6d | 7d 0a 0a 54 68 65 20 76 |verbatim|}..The v|
|00003800| 69 73 75 61 6c 20 65 76 | 69 64 65 6e 63 65 20 6f |isual ev|idence o|
|00003810| 66 20 61 6e 20 69 6e 63 | 6f 6e 73 69 73 74 65 6e |f an inc|onsisten|
|00003820| 74 20 43 53 47 20 6f 62 | 6a 65 63 74 20 76 61 72 |t CSG ob|ject var|
|00003830| 69 65 73 20 64 65 70 65 | 6e 64 69 6e 67 0a 75 70 |ies depe|nding.up|
|00003840| 6f 6e 20 74 68 65 20 6f | 70 65 72 61 74 6f 72 20 |on the o|perator |
|00003850| 62 65 69 6e 67 20 75 73 | 65 64 2e 0a 57 68 65 6e |being us|ed..When|
|00003860| 20 73 75 62 74 72 61 63 | 74 69 6e 67 20 61 20 63 | subtrac|ting a c|
|00003870| 6f 6e 73 69 73 74 65 6e | 74 20 6f 62 6a 65 63 74 |onsisten|t object|
|00003880| 20 66 72 6f 6d 20 61 6e | 64 0a 69 6e 63 6f 6e 73 | from an|d.incons|
|00003890| 69 73 74 65 6e 74 20 6f | 6e 65 2c 20 74 68 65 20 |istent o|ne, the |
|000038a0| 72 65 73 75 6c 74 69 6e | 67 20 6f 62 6a 65 63 74 |resultin|g object|
|000038b0| 20 77 69 6c 6c 20 61 70 | 70 65 61 72 20 74 6f 20 | will ap|pear to |
|000038c0| 62 65 0a 74 68 65 20 75 | 6e 69 6f 6e 20 6f 66 20 |be.the u|nion of |
|000038d0| 74 68 65 20 74 77 6f 20 | 6f 62 6a 65 63 74 73 2c |the two |objects,|
|000038e0| 20 62 75 74 20 74 68 65 | 20 73 68 61 64 69 6e 67 | but the| shading|
|000038f0| 20 77 69 6c 6c 20 62 65 | 20 69 6e 63 6f 72 72 65 | will be| incorre|
|00003900| 63 74 2e 0a 49 74 20 77 | 69 6c 6c 20 61 70 70 65 |ct..It w|ill appe|
|00003910| 61 72 20 74 6f 20 62 65 | 20 69 6e 73 69 64 65 2d |ar to be| inside-|
|00003920| 6f 75 74 20 69 6e 20 70 | 6c 61 63 65 73 2c 20 77 |out in p|laces, w|
|00003930| 68 69 6c 65 20 63 6f 72 | 72 65 63 74 0a 69 6e 20 |hile cor|rect.in |
|00003940| 6f 74 68 65 72 20 70 6c | 61 63 65 73 2e 20 20 54 |other pl|aces. T|
|00003950| 68 65 20 69 6e 73 69 64 | 65 2d 6f 75 74 20 73 65 |he insid|e-out se|
|00003960| 63 74 69 6f 6e 73 20 69 | 6e 64 69 63 61 74 65 20 |ctions i|ndicate |
|00003970| 74 68 65 20 61 72 65 61 | 73 0a 77 68 65 72 65 20 |the area|s.where |
|00003980| 74 68 65 20 70 72 6f 62 | 6c 65 6d 73 20 6f 63 63 |the prob|lems occ|
|00003990| 75 72 2e 0a 53 75 63 68 | 20 70 72 6f 62 6c 65 6d |ur..Such| problem|
|000039a0| 73 20 61 72 65 20 6f 66 | 74 65 6e 20 63 61 75 73 |s are of|ten caus|
|000039b0| 65 64 20 62 79 0a 70 6f | 6c 79 67 6f 6e 73 20 77 |ed by.po|lygons w|
|000039c0| 69 74 68 20 69 6e 63 6f | 72 72 65 63 74 6c 79 20 |ith inco|rrectly |
|000039d0| 73 70 65 63 69 66 69 65 | 64 0a 6e 6f 72 6d 61 6c |specifie|d.normal|
|000039e0| 73 2c 20 6f 72 20 62 79 | 20 73 75 72 66 61 63 65 |s, or by| surface|
|000039f0| 73 20 74 68 61 74 20 65 | 78 61 63 74 6c 79 20 63 |s that e|xactly c|
|00003a00| 6f 69 6e 63 69 64 65 20 | 28 77 68 69 63 68 0a 61 |oincide |(which.a|
|00003a10| 70 70 65 61 72 20 61 73 | 20 70 61 72 74 69 61 6c |ppear as| partial|
|00003a20| 20 60 60 53 77 69 73 73 | 20 63 68 65 65 73 65 27 | ``Swiss| cheese'|
|00003a30| 27 20 6f 62 6a 65 63 74 | 73 29 2e 0a 0a 54 68 65 |' object|s)...The|
|00003a40| 20 66 6f 6c 6c 6f 77 69 | 6e 67 20 65 78 61 6d 70 | followi|ng examp|
|00003a50| 6c 65 20 69 6c 6c 75 73 | 74 72 61 74 65 73 20 61 |le illus|trates a|
|00003a60| 6e 20 61 74 74 65 6d 70 | 74 20 74 6f 20 73 75 62 |n attemp|t to sub|
|00003a70| 74 72 61 63 74 20 61 20 | 73 70 68 65 72 65 20 66 |tract a |sphere f|
|00003a80| 72 6f 6d 0a 61 20 70 79 | 72 61 6d 69 64 20 64 65 |rom.a py|ramid de|
|00003a90| 66 69 6e 65 64 20 75 73 | 69 6e 67 20 61 6e 20 69 |fined us|ing an i|
|00003aa0| 6e 63 6f 72 72 65 63 74 | 6c 79 20 66 61 63 69 6e |ncorrect|ly facin|
|00003ab0| 67 20 74 72 69 61 6e 67 | 6c 65 2e 20 20 4e 6f 74 |g triang|le. Not|
|00003ac0| 65 0a 74 68 61 74 20 74 | 68 65 20 72 65 73 75 6c |e.that t|he resul|
|00003ad0| 74 69 6e 67 20 69 6d 61 | 67 65 20 6f 62 76 69 6f |ting ima|ge obvio|
|00003ae0| 75 73 6c 79 20 70 6f 69 | 6e 74 73 20 74 6f 20 77 |usly poi|nts to w|
|00003af0| 68 69 63 68 20 74 72 69 | 61 6e 67 6c 65 20 69 73 |hich tri|angle is|
|00003b00| 0a 72 65 76 65 72 73 65 | 64 2e 0a 0a 5c 62 65 67 |.reverse|d...\beg|
|00003b10| 69 6e 7b 76 65 72 62 61 | 74 69 6d 7d 0a 20 20 20 |in{verba|tim}. |
|00003b20| 20 6e 61 6d 65 20 70 79 | 72 61 6d 69 64 20 6c 69 | name py|ramid li|
|00003b30| 73 74 0a 20 20 20 20 20 | 20 20 20 74 72 69 61 6e |st. | trian|
|00003b40| 67 6c 65 20 31 20 30 20 | 30 20 20 30 20 31 20 30 |gle 1 0 |0 0 1 0|
|00003b50| 20 20 30 20 30 20 31 0a | 20 20 20 20 20 20 20 20 | 0 0 1.| |
|00003b60| 74 72 69 61 6e 67 6c 65 | 20 31 20 30 20 30 20 20 |triangle| 1 0 0 |
|00003b70| 30 20 30 20 30 20 20 30 | 20 31 20 30 0a 20 20 20 |0 0 0 0| 1 0. |
|00003b80| 20 20 20 20 20 74 72 69 | 61 6e 67 6c 65 20 30 20 | tri|angle 0 |
|00003b90| 31 20 30 20 20 30 20 30 | 20 30 20 20 30 20 30 20 |1 0 0 0| 0 0 0 |
|00003ba0| 31 0a 20 20 20 20 20 20 | 20 20 74 72 69 61 6e 67 |1. | triang|
|00003bb0| 6c 65 20 30 20 30 20 31 | 20 20 31 20 30 20 30 20 |le 0 0 1| 1 0 0 |
|00003bc0| 20 30 20 30 20 30 20 20 | 2f 2a 20 77 72 6f 6e 67 | 0 0 0 |/* wrong|
|00003bd0| 20 6f 72 64 65 72 20 2a | 2f 0a 20 20 20 20 65 6e | order *|/. en|
|00003be0| 64 0a 0a 20 20 20 20 64 | 69 66 66 65 72 65 6e 63 |d.. d|ifferenc|
|00003bf0| 65 0a 20 20 20 20 20 20 | 20 20 6f 62 6a 65 63 74 |e. | object|
|00003c00| 20 70 79 72 61 6d 69 64 | 20 73 63 61 6c 65 20 33 | pyramid| scale 3|
|00003c10| 20 33 20 33 20 72 6f 74 | 61 74 65 20 30 20 30 20 | 3 3 rot|ate 0 0 |
|00003c20| 31 20 34 35 0a 20 20 20 | 20 20 20 20 20 20 20 20 |1 45. | |
|00003c30| 20 72 6f 74 61 74 65 20 | 31 20 30 20 30 20 2d 33 | rotate |1 0 0 -3|
|00003c40| 30 20 74 72 61 6e 73 6c | 61 74 65 20 30 20 2d 33 |0 transl|ate 0 -3|
|00003c50| 2e 35 20 30 0a 20 20 20 | 20 20 20 20 20 73 70 68 |.5 0. | sph|
|00003c60| 65 72 65 20 32 2e 34 20 | 30 20 30 20 30 0a 20 20 |ere 2.4 |0 0 0. |
|00003c70| 20 20 65 6e 64 0a 5c 65 | 6e 64 7b 76 65 72 62 61 | end.\e|nd{verba|
|00003c80| 74 69 6d 7d 0a 0a 42 79 | 20 64 65 66 61 75 6c 74 |tim}..By| default|
|00003c90| 2c 20 63 79 6c 69 6e 64 | 65 72 73 20 61 6e 64 20 |, cylind|ers and |
|00003ca0| 63 6f 6e 65 73 20 64 6f | 20 6e 6f 74 20 68 61 76 |cones do| not hav|
|00003cb0| 65 20 65 6e 64 20 63 61 | 70 73 2c 20 61 6e 64 20 |e end ca|ps, and |
|00003cc0| 74 68 75 73 0a 61 72 65 | 20 6e 6f 74 20 63 6f 6e |thus.are| not con|
|00003cd0| 73 69 73 74 65 6e 74 20 | 70 72 69 6d 69 74 69 76 |sistent |primitiv|
|00003ce0| 65 73 2e 20 20 4f 6e 65 | 20 6d 75 73 74 20 75 73 |es. One| must us|
|00003cf0| 75 61 6c 6c 79 0a 61 64 | 64 20 65 6e 64 63 61 70 |ually.ad|d endcap|
|00003d00| 73 20 62 79 20 6c 69 73 | 74 69 6e 67 20 74 68 65 |s by lis|ting the|
|00003d10| 0a 63 79 6c 69 6e 64 65 | 72 20 6f 72 20 63 6f 6e |.cylinde|r or con|
|00003d20| 65 20 77 69 74 68 20 28 | 63 6f 72 72 65 63 74 6c |e with (|correctl|
|00003d30| 79 2d 6f 72 69 65 6e 74 | 65 64 29 20 65 6e 64 63 |y-orient|ed) endc|
|00003d40| 61 70 20 64 69 73 63 73 | 20 69 6e 20 61 6e 20 61 |ap discs| in an a|
|00003d50| 67 67 72 65 67 61 74 65 | 2e 0a 0a 5c 73 65 63 74 |ggregate|...\sect|
|00003d60| 69 6f 6e 20 7b 4e 61 6d | 65 64 20 4f 62 6a 65 63 |ion {Nam|ed Objec|
|00003d70| 74 73 7d 0a 0a 41 20 6e | 61 6d 65 20 6d 61 79 20 |ts}..A n|ame may |
|00003d80| 62 65 20 61 73 73 6f 63 | 69 61 74 65 64 20 77 69 |be assoc|iated wi|
|00003d90| 74 68 20 61 6e 79 20 70 | 72 69 6d 69 74 69 76 65 |th any p|rimitive|
|00003da0| 2c 20 61 67 67 72 65 67 | 61 74 65 2c 20 6f 72 20 |, aggreg|ate, or |
|00003db0| 43 53 47 0a 6f 62 6a 65 | 63 74 20 74 68 72 6f 75 |CSG.obje|ct throu|
|00003dc0| 67 68 20 74 68 65 20 75 | 73 65 20 6f 66 20 74 68 |gh the u|se of th|
|00003dd0| 65 20 7b 5c 74 74 20 6e | 61 6d 65 7d 0a 6b 65 79 |e {\tt n|ame}.key|
|00003de0| 77 6f 72 64 3a 0a 0a 5c | 62 65 67 69 6e 7b 64 65 |word:..\|begin{de|
|00003df0| 66 6b 65 79 7d 7b 6e 61 | 6d 65 7d 7b 7b 5c 65 6d |fkey}{na|me}{{\em|
|00003e00| 20 6f 62 6a 6e 61 6d 65 | 7d 20 24 3c 24 7b 5c 65 | objname|} $<${\e|
|00003e10| 6d 20 49 6e 73 74 61 6e | 63 65 5c 2f 7d 24 3e 24 |m Instan|ce\/}$>$|
|00003e20| 7d 0a 09 41 73 73 6f 63 | 69 61 74 65 20 7b 5c 65 |}..Assoc|iate {\e|
|00003e30| 6d 20 6f 62 6a 6e 61 6d | 65 7d 20 77 69 74 68 20 |m objnam|e} with |
|00003e40| 74 68 65 20 67 69 76 65 | 6e 20 6f 62 6a 65 63 74 |the give|n object|
|00003e50| 2e 20 20 54 68 65 0a 09 | 73 70 65 63 69 66 69 65 |. The..|specifie|
|00003e60| 64 20 6f 62 6a 65 63 74 | 20 69 73 20 6e 6f 74 20 |d object| is not |
|00003e70| 61 63 74 75 61 6c 6c 79 | 20 69 6e 73 74 61 6e 74 |actually| instant|
|00003e80| 69 61 74 65 64 3b 20 69 | 74 0a 09 69 73 20 6f 6e |iated; i|t..is on|
|00003e90| 6c 79 20 73 74 6f 72 65 | 64 20 75 6e 64 65 72 20 |ly store|d under |
|00003ea0| 74 68 65 20 67 69 76 65 | 6e 20 6e 61 6d 65 2e 0a |the give|n name..|
|00003eb0| 5c 65 6e 64 7b 64 65 66 | 6b 65 79 7d 0a 0a 41 6e |\end{def|key}..An|
|00003ec0| 20 6f 62 6a 65 63 74 20 | 74 68 75 73 20 6e 61 6d | object |thus nam|
|00003ed0| 65 64 20 6d 61 79 20 74 | 68 65 6e 20 62 65 20 69 |ed may t|hen be i|
|00003ee0| 6e 73 74 61 6e 74 69 61 | 74 65 64 20 28 77 69 74 |nstantia|ted (wit|
|00003ef0| 68 20 70 6f 73 73 69 62 | 6c 65 0a 61 64 64 69 74 |h possib|le.addit|
|00003f00| 69 6f 6e 61 6c 20 74 72 | 61 6e 73 66 6f 72 6d 69 |ional tr|ansformi|
|00003f10| 6e 67 20 61 6e 64 20 74 | 65 78 74 75 72 69 6e 67 |ng and t|exturing|
|00003f20| 29 20 76 69 61 20 74 68 | 65 20 7b 5c 74 74 20 6f |) via th|e {\tt o|
|00003f30| 62 6a 65 63 74 7d 20 6b | 65 79 77 6f 72 64 3a 0a |bject} k|eyword:.|
|00003f40| 0a 5c 62 65 67 69 6e 7b | 64 65 66 6b 65 79 7d 7b |.\begin{|defkey}{|
|00003f50| 6f 62 6a 65 63 74 7d 7b | 7b 5c 65 6d 20 6f 62 6a |object}{|{\em obj|
|00003f60| 6e 61 6d 65 7d 20 5b 24 | 3c 24 54 72 61 6e 73 66 |name} [$|<$Transf|
|00003f70| 6f 72 6d 61 74 69 6f 6e | 73 24 3e 24 5d 20 5b 24 |ormation|s$>$] [$|
|00003f80| 3c 24 54 65 78 74 75 72 | 65 73 24 3e 24 5d 7d 0a |<$Textur|es$>$]}.|
|00003f90| 09 49 6e 73 74 61 6e 74 | 69 61 74 65 20 61 20 63 |.Instant|iate a c|
|00003fa0| 6f 70 79 20 6f 66 20 74 | 68 65 20 6f 62 6a 65 63 |opy of t|he objec|
|00003fb0| 74 20 61 73 73 6f 63 69 | 61 74 65 64 20 77 69 74 |t associ|ated wit|
|00003fc0| 68 20 7b 5c 65 6d 20 6f | 62 6a 6e 61 6d 65 7d 2e |h {\em o|bjname}.|
|00003fd0| 0a 09 49 66 20 67 69 76 | 65 6e 2c 20 74 68 65 20 |..If giv|en, the |
|00003fe0| 74 72 61 6e 73 66 6f 72 | 6d 61 74 69 6f 6e 73 20 |transfor|mations |
|00003ff0| 61 6e 64 20 74 65 78 74 | 75 72 65 73 20 61 72 65 |and text|ures are|
|00004000| 20 63 6f 6d 70 6f 73 65 | 64 0a 09 77 69 74 68 20 | compose|d..with |
|00004010| 61 6e 79 20 61 6c 72 65 | 61 64 79 20 61 73 73 6f |any alre|ady asso|
|00004020| 63 69 61 74 65 64 20 77 | 69 74 68 0a 09 74 68 65 |ciated w|ith..the|
|00004030| 20 6f 62 6a 65 63 74 20 | 62 65 69 6e 67 20 69 6e | object |being in|
|00004040| 73 74 61 6e 74 69 61 74 | 65 64 2e 0a 5c 65 6e 64 |stantiat|ed..\end|
|00004050| 7b 64 65 66 6b 65 79 7d | 0a |{defkey}|. |
+--------+-------------------------+-------------------------+--------+--------+